﻿        @import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Sora:wght@600;700;800&display=swap');

        /* إزالة الشريط السفلي من متصفح الهاتف */
        html,
        body {
            overscroll-behavior: none;
            -webkit-overflow-scrolling: touch;
            height: 100%;
            overflow: hidden;
        }

        :root {
            --app-top-banner-height: 1.5cm;
        }

        body {
            position: fixed;
            width: 100%;
            height: 100%;
            overflow: hidden;
            box-sizing: border-box;
            padding-top: var(--app-top-banner-height);
        }

        .app-global-top-bar {
            position: fixed;
            top: 0;
            left: var(--app-global-topbar-left-edge, var(--app-left-sidebar-width, 0px));
            right: 0;
            height: 1.5cm;
            display: none;
            background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
            color: #0f172a;
            z-index: 5000;
            align-items: center;
            justify-content: center;
            padding: 0 22px;
            font-family: 'Sora', 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
            font-weight: 700;
            letter-spacing: 0.2px;
            border-bottom: 1px solid rgba(226, 232, 240, 0.96);
            box-shadow: 0 12px 26px rgba(148, 163, 184, 0.16);
            transition: left 0.28s ease, height 0.2s ease, padding 0.2s ease;
        }

        .app-global-top-title {
            min-width: 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .workspace-topbar-host {
            display: none;
            flex: 1 1 auto;
            min-width: 0;
            align-items: center;
            justify-content: stretch;
            width: 100%;
        }

        body.dark-theme .app-global-top-bar {
            background: linear-gradient(135deg, #3f0410 0%, #5d0b1c 55%, #7f1327 100%);
            color: #fff1f2;
        }

        body.qcm-workspace-active {
            --app-top-banner-height: 3cm;
            --qcm-unified-action-height: 0.5cm;
            --workspace-topbar-button-height: 32px;
            padding-top: 3cm;
        }

        body.qcm-workspace-active .app-global-top-bar {
            display: flex !important;
            height: 3cm !important;
            align-items: flex-start;
            justify-content: stretch;
            gap: 6px;
            padding: 0 4px;
        }

        body:not(.dark-theme).qcm-workspace-active .app-global-top-bar {
            background: #ffffff !important;
            background-color: #ffffff !important;
            background-image: none !important;
            border-bottom: none !important;
            box-shadow: none !important;
        }

        body.qcm-workspace-active .app-global-top-title {
            display: none;
        }

        body.qcm-workspace-active .workspace-topbar-host {
            display: flex;
            align-items: flex-start;
            height: 100%;
        }

        body.split-companion-active .app-global-top-bar {
            left: calc(var(--workspace-split-qcm-left, 50vw) - 10px) !important;
            right: auto !important;
            width: calc(var(--workspace-split-qcm-width, 50vw) + 20px) !important;
            padding: 0 6px !important;
            box-sizing: border-box;
            border-left: none;
            border-right: none;
            border-bottom: 1px solid rgba(226, 232, 240, 0.96);
            border-bottom-left-radius: 18px;
            border-bottom-right-radius: 22px;
            overflow: hidden;
            box-shadow: 0 16px 34px rgba(148, 163, 184, 0.16);
        }

        body.split-companion-active .workspace-topbar-host {
            overflow: hidden;
            padding: 0;
            box-sizing: border-box;
            scrollbar-width: none;
        }

        /* Mobile Responsive */
        @media (max-width: 768px) {
            .app-global-top-bar {
                left: 0 !important;
                right: 0 !important;
            }

            body {
                flex-direction: column;
                overflow-y: auto;
            }

            aside {
                width: 100% !important;
                height: calc(100vh - var(--app-top-safe-offset, 0px)) !important;
                height: calc(100dvh - var(--app-top-safe-offset, 0px)) !important;
                position: fixed !important;
                top: var(--app-top-safe-offset, 0px);
                left: 0;
                z-index: 1000;
                transform: translateX(-100%);
                transition: transform 0.3s ease;
                overflow-y: auto !important;
            }

            aside.active {
                transform: translateX(0);
            }

            main {
                margin-left: 0 !important;
                padding: 10px !important;
                width: 100% !important;
                overflow-x: hidden !important;
            }

            .modules-container {
                grid-template-columns: 1fr !important;
                gap: 10px !important;
            }

            .lessons-grid {
                grid-template-columns: 1fr !important;
            }

            .launch-btn {
                padding: 15px 30px !important;
                font-size: 16px !important;
                margin: 15px 0 !important;
            }

            .year-title {
                font-size: 18px !important;
            }

            .year-title i {
                width: 35px !important;
                height: 35px !important;
                font-size: 16px !important;
            }

            .total-questions {
                padding: 8px 15px !important;
                font-size: 14px !important;
            }

            .module-card {
                padding: 15px !important;
                overflow: visible !important;
            }

            .module-name {
                font-size: 16px !important;
            }

            .lesson-item {
                padding: 10px !important;
                min-height: 40px !important;
                overflow: visible !important;
                position: relative !important;
            }

            .lesson-name {
                font-size: 12px !important;
                max-width: 70% !important;
            }

            .lesson-question-count {
                font-size: 9px !important;
                padding: 3px 8px !important;
                min-width: 35px !important;
                position: absolute !important;
                right: 10px !important;
                top: 50% !important;
                transform: translateY(-50%) !important;
            }

            .setup-filters {
                padding: 15px !important;
                grid-template-columns: 1fr !important;
                margin-bottom: 15px !important;
                overflow: visible !important;
                max-height: none !important;
            }

            .filter-options {
                flex-wrap: wrap !important;
                gap: 8px !important;
            }

            .filter-option {
                font-size: 12px !important;
                min-width: 45px !important;
                white-space: nowrap !important;
            }

            #quiz-header {
                padding: 0 10px !important;
                height: auto !important;
                flex-direction: column;
                gap: 5px;
                padding: 10px !important;
            }

            #q-count-top {
                padding: 8px 15px !important;
                font-size: 12px !important;
            }

            #question-card {
                padding: 15px !important;
                overflow: visible !important;
            }

            .question-number {
                top: -12px !important;
                left: 15px !important;
                width: 30px !important;
                height: 30px !important;
                font-size: 14px !important;
            }

            .opt-btn {
                padding: 8px 12px !important;
                margin-bottom: 4px !important;
                min-height: 35px !important;
                position: relative;
            }

            .opt-id {
                min-width: 25px !important;
                height: 25px !important;
                font-size: 11px !important;
            }

            .opt-text {
                font-size: 13px !important;
            }

            .justification-bubble {
                margin-left: 35px !important;
                padding: 10px 15px !important;
            }

            #sidebar-nav {
                position: fixed !important;
                top: calc(var(--app-top-safe-offset, 0px) + 6px) !important;
                left: 8px !important;
                right: 8px !important;
                width: auto !important;
                min-width: 0 !important;
                max-width: none !important;
                height: calc(100vh - var(--app-top-safe-offset, 0px) - 16px) !important;
                height: calc(100dvh - var(--app-top-safe-offset, 0px) - 16px) !important;
                z-index: 3600 !important;
                transform: translateY(18px) scale(0.985);
                transform-origin: top center;
                opacity: 0;
                transition: transform 0.28s ease, opacity 0.28s ease;
                overflow: hidden !important;
                pointer-events: none;
                border-radius: 24px !important;
                border: 1px solid rgba(203, 213, 225, 0.95) !important;
                background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(241, 245, 249, 0.99) 100%) !important;
                box-shadow: 0 22px 48px rgba(15, 23, 42, 0.28);
            }

            #sidebar-nav.active {
                transform: translateY(0) scale(1);
                opacity: 1;
                pointer-events: auto;
            }

            #left-sidebar {
                position: fixed !important;
                top: calc(var(--app-top-safe-offset, 0px) + 4px) !important;
                left: 0 !important;
                width: min(320px, calc(100vw - 40px)) !important;
                min-width: min(320px, calc(100vw - 40px)) !important;
                max-width: calc(100vw - 40px) !important;
                height: calc(100vh - var(--app-top-safe-offset, 0px) - 8px) !important;
                height: calc(100dvh - var(--app-top-safe-offset, 0px) - 8px) !important;
                transform: translateX(-108%);
                transition: transform 0.3s ease;
                z-index: 3400 !important;
                border-radius: 0 20px 20px 0;
                overflow: hidden;
                box-shadow: 0 20px 44px rgba(15, 23, 42, 0.34);
            }

            #left-sidebar.active {
                transform: translateX(0);
            }

            #left-sidebar nav {
                height: auto !important;
                min-height: 0;
            }

            .socials-modern-panel {
                width: 95% !important;
                padding: 20px !important;
                max-height: 85vh !important;
            }

            .filter-row {
                flex-direction: column !important;
                gap: 10px !important;
            }

            .filter-select {
                min-width: 100% !important;
                font-size: 14px !important;
                padding: 10px !important;
            }

            .text-context-menu {
                min-width: 280px !important;
                font-size: 12px !important;
            }

            .context-menu-btn {
                padding: 8px 12px !important;
                font-size: 12px !important;
            }

            .context-menu-btn i {
                font-size: 14px !important;
            }

            .filter-badge {
                font-size: 10px !important;
                padding: 4px 8px !important;
                margin-bottom: 4px !important;
            }

            .question-filters {
                flex-wrap: wrap !important;
            }

            .selected-answers-display {
                padding: 10px !important;
            }

            .answer-item {
                padding: 4px 8px !important;
                font-size: 10px !important;
            }

            .year-header {
                flex-direction: column;
                align-items: flex-start !important;
                gap: 10px;
            }

            .year-stats {
                width: 100%;
                justify-content: space-between;
            }

            .module-header {
                flex-direction: column;
                align-items: flex-start !important;
                gap: 10px;
                overflow: visible !important;
            }

            .year-section.collapsed .modules-container {
                display: none !important;
            }

            .module-card.collapsed .lessons-grid {
                display: none !important;
            }

            #desktop-quick-search-input {
                width: 100%;
                padding: 8px 12px;
                border: 2px solid #e2e8f0;
                border-radius: 8px;
                font-size: 14px;
            }

            .question-buttons-row {
                display: flex;
                flex-wrap: wrap;
                gap: 8px;
                justify-content: center;
            }

            .question-btn {
                flex: 1;
                min-width: 45px;
                padding: 8px 5px;
                border-radius: 10px;
                font-size: 12px;
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                gap: 2px;
            }

            .question-btn i {
                font-size: 14px;
            }

            .question-btn span {
                font-size: 9px;
            }

            #years-container {
                overflow: visible !important;
                max-height: none !important;
            }

            .year-section {
                overflow: visible !important;
                position: relative;
                z-index: 1;
            }

            .modules-container {
                position: relative;
                z-index: 1;
                overflow: visible !important;
            }

            .module-card {
                position: relative;
                z-index: 1;
            }

            .lesson-item {
                position: relative;
                z-index: 2;
            }

            .year-checkbox,
            .module-checkbox,
            .lesson-checkbox {
                width: 20px !important;
                height: 20px !important;
                min-width: 20px !important;
                min-height: 20px !important;
                margin-right: 10px !important;
            }

            .lesson-checkbox {
                margin-right: 12px !important;
            }

            .q-count-input {
                width: 50px !important;
                padding: 4px 8px !important;
                font-size: 12px !important;
                position: absolute !important;
                right: 50px !important;
                top: 50% !important;
                transform: translateY(-50%) !important;
                display: none !important;
            }

            .lesson-item:hover .q-count-input,
            .lesson-item:active .q-count-input {
                display: inline-block !important;
            }

            /* Study mode mobile optimization */
            #study-modal .bg-white {
                flex-direction: column;
                width: 100vw !important;
                height: 100vh !important;
                height: 100dvh !important;
                border-radius: 0 !important;
                max-width: none !important;
                max-height: none !important;
            }

            #study-container {
                flex-direction: row;
            }

            #quiz-container,
            #course-container {
                width: 50% !important;
                height: 100% !important;
                min-width: 0 !important;
                min-height: 0 !important;
            }

            #course-container {
                border-top: none;
                border-right: 1px solid #e2e8f0;
            }

            .search-timer-row {
                flex-direction: column;
                gap: 10px;
                margin-bottom: 10px;
            }

            .search-timer-row>div {
                width: 100%;
            }

            .desktop-only {
                display: none !important;
            }

            .mobile-only {
                display: block !important;
            }

            #left-sidebar.desktop-only,
            #sidebar-nav.desktop-only {
                display: flex !important;
                z-index: 3400 !important;
            }

            #left-sidebar.desktop-only {
                display: block !important;
            }

            #left-sidebar .app-sidebar-inner {
                width: 100%;
                max-width: 100%;
            }

            #left-sidebar.active,
            #sidebar-nav.active {
                z-index: 3600 !important;
            }

            body.mobile-sidebar-open #quiz-top-unified-card,
            body.mobile-sidebar-open #question-filters-bar,
            body.mobile-sidebar-open #question-stats,
            body.mobile-sidebar-open #qcm-control-bar {
                position: relative;
                z-index: 1 !important;
            }

            body.mobile-top-banner-hidden #main-content > .app-top-banner {
                display: none !important;
            }

            body.mobile-sidebar-open .mobile-sidebars-toggle {
                z-index: 1300 !important;
            }

            .mobile-sidebars-toggle {
                position: fixed;
                top: var(--app-top-safe-offset, calc(var(--app-top-banner-height, 96px) + 4px));
                right: 10px;
                z-index: 1205;
                display: flex !important;
                gap: 8px;
            }

            .mobile-sidebars-toggle button {
                width: 36px;
                height: 36px;
                border: none;
                border-radius: 10px;
                background: #0f172a;
                color: #fff;
                font-size: 13px;
                display: flex;
                align-items: center;
                justify-content: center;
                box-shadow: 0 8px 16px rgba(15, 23, 42, 0.28);
            }

            .mobile-sidebars-toggle button:active {
                transform: scale(0.96);
            }

            body.qcm-workspace-active .mobile-sidebars-toggle {
                display: none !important;
            }

            .mobile-sidebar-overlay {
                display: block;
                position: fixed;
                inset: 0;
                background: rgba(15, 23, 42, 0.42);
                backdrop-filter: blur(2px);
                opacity: 0;
                pointer-events: none;
                transition: opacity 0.25s ease;
                z-index: 3300;
            }

            body.mobile-sidebar-open .mobile-sidebar-overlay {
                opacity: 1;
                pointer-events: auto;
            }

            .mobile-sidebar-panel-header {
                display: flex !important;
                align-items: center;
                justify-content: space-between;
                gap: 10px;
                padding: 12px 14px 10px;
                position: sticky;
                top: 0;
                z-index: 2;
            }

            .mobile-sidebar-panel-header.is-dark {
                background: linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0%, rgba(30, 41, 59, 0.92) 100%);
                border-bottom: 1px solid rgba(148, 163, 184, 0.22);
            }

            .mobile-sidebar-panel-header.is-light {
                background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(241, 245, 249, 0.98) 100%);
                border-bottom: 1px solid #e2e8f0;
            }

            .mobile-sidebar-panel-title {
                display: inline-flex;
                align-items: center;
                gap: 8px;
                min-width: 0;
                font-size: 12px;
                font-weight: 900;
                letter-spacing: 0.01em;
            }

            .mobile-sidebar-panel-header.is-dark .mobile-sidebar-panel-title {
                color: #ffffff;
            }

            .mobile-sidebar-panel-header.is-light .mobile-sidebar-panel-title {
                color: #0f172a;
            }

            .mobile-sidebar-close-btn {
                width: 32px;
                height: 32px;
                border: 1px solid rgba(148, 163, 184, 0.3);
                border-radius: 999px;
                background: rgba(255, 255, 255, 0.12);
                color: inherit;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                flex-shrink: 0;
            }

            .mobile-sidebar-panel-header.is-light .mobile-sidebar-close-btn {
                background: #ffffff;
                color: #334155;
            }

            .question-timers {
                margin-top: 10px;
                margin-bottom: 15px;
            }

            /* حذف أزرار الموبايل السفلية */
            .mobile-sidebar-buttons {
                display: none !important;
            }

            /* حذف زر القائمة الجانبية الرئيسية */
            .sidebar-toggle-btn {
                display: none !important;
            }

            /* حذف زر التاريخ */
            .toggle-history-btn {
                display: none !important;
            }

            /* Adjust content padding for mobile */
            main {
                padding-bottom: 20px !important;
            }

            .history-sidebar {
                width: 100% !important;
                position: fixed !important;
                top: var(--app-top-safe-offset, 0px) !important;
                right: 0 !important;
                height: calc(100vh - var(--app-top-safe-offset, 0px)) !important;
                height: calc(100dvh - var(--app-top-safe-offset, 0px)) !important;
                z-index: 3400 !important;
                transform: translateX(100%);
                transition: transform 0.3s ease;
                overflow-y: auto !important;
            }

            .history-sidebar.active {
                z-index: 3450 !important;
                transform: translateX(0);
            }

            .search-input-mobile {
                width: 100%;
                padding: 10px 12px;
                border: 2px solid #e2e8f0;
                border-radius: 8px;
                font-size: 14px;
            }

            .mobile-q-count {
                width: 60px;
                padding: 6px 8px;
                border: 1px solid #cbd5e1;
                border-radius: 5px;
                font-size: 12px;
                text-align: center;
            }

            .filter-group {
                max-height: 200px;
                overflow-y: auto;
                padding-right: 5px;
            }

            .filter-group::-webkit-scrollbar {
                width: 4px;
            }

            .filter-group::-webkit-scrollbar-thumb {
                background: #cbd5e1;
                border-radius: 2px;
            }

            .main-action-buttons {
                flex-direction: column !important;
                gap: 10px !important;
            }

            .main-action-btn {
                min-width: 100% !important;
                padding: 12px !important;
            }

            .study-main-actions {
                flex-direction: row !important;
                flex-wrap: nowrap !important;
                gap: 6px !important;
            }

            .study-main-action-btn {
                min-width: 0 !important;
                width: auto !important;
                padding: 6px 7px !important;
                font-size: 10px !important;
            }

            .lesson-item,
            .module-header,
            .year-title {
                -webkit-tap-highlight-color: transparent;
                touch-action: manipulation;
            }

            /* Prevent zoom on mobile inputs */
            input,
            select,
            textarea {
                font-size: 16px !important;
                max-height: 44px !important;
            }

            /* Landscape mode adjustments */
            @media (orientation: landscape) {
                #study-container {
                    flex-direction: row;
                }

                #quiz-container,
                #course-container {
                    width: 50% !important;
                    height: 100% !important;
                }

                .mobile-only {
                    display: block !important;
                }
            }
        }

        @media (min-width: 769px) {
            .mobile-only {
                display: none !important;
            }

            .desktop-only {
                display: block !important;
            }
        }

        @media (max-width: 480px) {
            .launch-btn {
                padding: 12px 25px !important;
                font-size: 14px !important;
                gap: 10px !important;
            }

            .year-section {
                padding: 15px !important;
                margin-bottom: 8px !important;
            }

            .module-card {
                padding: 12px !important;
            }

            .selected-answers-display {
                font-size: 12px !important;
            }

            .question-buttons-row {
                gap: 5px;
            }

            .question-btn {
                min-width: 40px;
                padding: 6px 3px;
                font-size: 10px;
            }

            .question-btn i {
                font-size: 12px;
            }

            .question-btn span {
                font-size: 8px;
            }

            .lesson-item {
                padding: 12px 8px !important;
            }

            .lesson-name {
                font-size: 11px !important;
                max-width: 60% !important;
            }

            .lesson-question-count {
                font-size: 8px !important;
                padding: 2px 6px !important;
                min-width: 30px !important;
            }
        }

        /* Base Styles */
        body {
            font-family: 'Plus Jakarta Sans', sans-serif;
            background: linear-gradient(135deg, #d7dde4 0%, #eef2f6 52%, #cfd6de 100%);
            min-height: 100vh;
            overflow-x: hidden;
            display: flex;
            transition: margin 0.3s ease;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        #main-content,
        #setup-section {
            background: linear-gradient(180deg, rgba(237, 241, 245, 0.96) 0%, rgba(224, 230, 236, 0.96) 100%);
        }

        #main-content {
            min-height: 0;
            height: calc(100vh - var(--app-top-banner-height));
            height: calc(100dvh - var(--app-top-banner-height));
            overflow: hidden;
        }

        #setup-section {
            min-height: 0;
            padding-bottom: 24px !important;
            padding-top: 16px !important;
            overflow-x: hidden;
            overflow-y: auto;
            overscroll-behavior: contain;
            scroll-padding-top: calc(var(--global-top-bar-height, 1.5cm) + 24px);
        }

        #setup-section:not(.test-workspace-active) {
            background: #ffffff;
        }

        /* Enhanced touch targets for mobile */
        @media (max-width: 768px) {

            button,
            .opt-btn,
            .lesson-item,
            .module-header {
                min-height: 44px;
                cursor: pointer;
            }

            input[type="checkbox"],
            input[type="radio"] {
                min-width: 20px;
                min-height: 20px;
            }
        }

        .year-section {
            background: rgba(255, 255, 255, 0.95);
            border-radius: 10px;
            padding: 8px;
            margin-bottom: 4px;
            color: #333;
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
            transition: all 0.3s ease;
            backdrop-filter: blur(10px);
            border: none;
            cursor: pointer;
        }

        .year-section:hover {
            transform: translateY(-3px);
            box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
        }

        .year-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
            padding-bottom: 6px;
            border-bottom: 1px solid rgba(102, 126, 234, 0.18);
        }

        .year-title {
            font-size: 12px !important;
            font-weight: 900;
            letter-spacing: -0.2px;
            display: flex;
            align-items: center;
            gap: 6px;
            color: #4f46e5;
        }

        .year-title i {
            font-size: 11px;
            background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
            width: 24px;
            height: 24px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            box-shadow: 0 4px 10px rgba(79, 70, 229, 0.22);
        }

        .year-checkbox {
            width: 14px;
            height: 14px;
            margin-right: 6px;
            cursor: pointer;
            accent-color: #4f46e5;
        }

        .year-stats {
            display: flex;
            gap: 10px;
            align-items: center;
        }

        .total-questions {
            background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
            color: white;
            padding: 4px 8px;
            border-radius: 9999px;
            font-size: 10px;
            font-weight: 900;
            box-shadow: 0 4px 10px rgba(79, 70, 229, 0.18);
        }

        .modules-container {
            display: grid;
            grid-template-columns: 1fr;
            gap: 8px;
            margin-top: 8px;
        }

        .module-card {
            background: rgba(255, 255, 255, 0.9);
            border-radius: 9px;
            padding: 8px;
            transition: all 0.3s ease;
            border: none;
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
        }

        .module-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
            background: white;
        }

        .module-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 6px;
            padding-bottom: 6px;
            border-bottom: 1px solid rgba(102, 126, 234, 0.10);
            cursor: pointer;
        }

        .module-name {
            font-size: 12px !important;
            font-weight: 800;
            color: #4f46e5;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .module-checkbox {
            width: 14px;
            height: 14px;
            margin-right: 6px;
            cursor: pointer;
            accent-color: #4f46e5;
        }

        .lessons-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 6px;
            margin-top: 6px;
        }

        .lesson-item {
            display: flex;
            align-items: center;
            padding: 6px 8px;
            background: rgba(249, 250, 251, 0.9);
            border-radius: 9px;
            border: 1px solid transparent;
            font-size: 10px !important;
            min-height: 32px;
            transition: all 0.2s;
            position: relative;
        }

        .lesson-item:hover {
            background: white;
            border-color: #4f46e5;
            transform: translateY(-2px);
            box-shadow: 0 4px 10px rgba(79, 70, 229, 0.1);
        }

        .lesson-checkbox {
            width: 12px;
            height: 12px;
            margin-right: 6px;
            cursor: pointer;
            flex-shrink: 0;
            accent-color: #4f46e5;
        }

        .lesson-name {
            flex: 1;
            color: #333;
            font-weight: 600;
            font-size: 10px !important;
            white-space: normal;
            word-wrap: break-word;
            overflow-wrap: break-word;
            line-height: 1.2;
            margin-right: 6px;
        }

        .lesson-question-count {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            color: white;
            padding: 1px 6px;
            border-radius: 9999px;
            font-size: 8px;
            font-weight: 900;
            margin-left: 6px;
            flex-shrink: 0;
            min-width: 26px;
            text-align: center;
            box-shadow: 0 2px 6px rgba(16, 185, 129, 0.18);
        }

        .year-section[data-year="1 ère médecine"] {
            background: rgba(255, 255, 255, 0.95);
            border-left: 6px solid #4f46e5;
        }

        .year-section[data-year="2 ème médecine"] {
            background: rgba(255, 255, 255, 0.95);
            border-left: 6px solid #10b981;
        }

        .year-section[data-year="3 ème médecine"] {
            background: rgba(255, 255, 255, 0.95);
            border-left: 6px solid #f59e0b;
        }

        .year-section[data-year="4 ème médecine"] {
            background: rgba(255, 255, 255, 0.95);
            border-left: 6px solid #ef4444;
        }

        .year-section[data-year="5 ème médecine"] {
            background: rgba(255, 255, 255, 0.95);
            border-left: 6px solid #8b5cf6;
        }

        .year-section[data-year="6 ème médecine"] {
            background: rgba(255, 255, 255, 0.95);
            border-left: 6px solid #3b82f6;
        }

        .launch-btn-container {
            display: flex;
            justify-content: flex-end;
            width: 100%;
            margin-top: 8px;
            padding: 0 8px 0 0;
        }

        .launch-btn {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            color: white;
            padding: 10px 18px;
            border-radius: 999px;
            font-size: 12px;
            font-weight: 900;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            min-height: 34px;
            width: auto;
            max-width: 100%;
            box-shadow: 0 10px 24px rgba(16, 185, 129, 0.28);
            transition: all 0.3s;
            text-transform: uppercase;
            letter-spacing: 0.8px;
        }

        .launch-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 14px 28px rgba(16, 185, 129, 0.34);
        }

        .app-top-banner {
            flex-shrink: 0;
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 16px;
            background: linear-gradient(135deg, #4a0613 0%, #6f1022 55%, #8b1a2b 100%);
            border-bottom: 1px solid rgba(254, 202, 202, 0.24);
            box-shadow: 0 16px 30px rgba(69, 10, 20, 0.3);
            position: relative;
            z-index: 2200;
        }

        .app-top-banner-main {
            display: flex;
            align-items: center;
            gap: 12px;
            min-width: 0;
            flex: 1 1 auto;
            width: 100%;
        }

        .app-top-banner-avatar {
            width: 58px;
            height: 58px;
            border-radius: 999px;
            object-fit: cover;
            border: 2px solid rgba(255, 255, 255, 0.95);
            box-shadow: 0 8px 18px rgba(79, 70, 229, 0.18);
            flex-shrink: 0;
            background: #fff;
        }

        .app-top-banner-mobile-rail {
            display: flex;
            align-items: center;
            gap: 12px;
            flex-shrink: 0;
        }

        .app-top-banner-mobile-actions {
            display: none;
        }

        .app-top-banner-mobile-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 32px;
            height: 32px;
            border: 1px solid rgba(191, 219, 254, 0.95);
            border-radius: 10px;
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(239, 246, 255, 0.98) 100%);
            color: #1d4ed8;
            font-size: 13px;
            box-shadow: 0 8px 18px rgba(148, 163, 184, 0.16);
            transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
        }

        .app-top-banner-mobile-btn:active {
            transform: scale(0.96);
        }

        .mobile-sidebar-bottom-nav {
            display: none;
        }

        .mobile-sidebar-bottom-btn {
            border: none;
            background: transparent;
            cursor: pointer;
            transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
            touch-action: manipulation;
        }

        .mobile-sidebar-bottom-btn:active {
            transform: scale(0.95);
        }

        .mobile-test-next-btn {
            display: none;
        }

        .app-top-banner-mobile-btn.is-active {
            background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
            border-color: rgba(37, 99, 235, 0.98);
            color: #ffffff;
            box-shadow: 0 10px 20px rgba(37, 99, 235, 0.28);
        }

        .app-top-banner-copy {
            min-width: 0;
            display: grid;
            grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
            grid-template-areas:
                "title quote"
                "links quote";
            align-items: center;
            column-gap: 10px;
            row-gap: 6px;
            flex: 1 1 auto;
            max-width: none;
            width: 100%;
        }

        .app-top-banner-title {
            grid-area: title;
            font-size: 14px;
            font-weight: 900;
            color: #fff1f2;
            line-height: 1.1;
            letter-spacing: -0.02em;
            width: fit-content;
            max-width: 100%;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .app-top-banner-links {
            grid-area: links;
            display: flex;
            align-items: center;
            flex-wrap: nowrap;
            gap: 5px;
            width: fit-content;
            max-width: 100%;
        }

        .app-top-banner-link {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 22px;
            padding: 3px 8px;
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.12);
            border: 1px solid rgba(254, 202, 202, 0.36);
            color: #fff1f2;
            font-size: 7.4px;
            font-weight: 800;
            line-height: 1;
            text-decoration: none;
            white-space: nowrap;
            width: auto;
            min-width: auto;
            transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
        }

        .app-top-banner-link:hover {
            background: rgba(255, 255, 255, 0.2);
            border-color: rgba(254, 226, 226, 0.62);
            color: #ffffff;
            transform: translateY(-1px);
        }

        .app-top-banner-quote {
            grid-area: quote;
            align-self: stretch;
            display: flex;
            align-items: center;
            width: 100%;
            max-width: none;
            min-height: 58px;
            padding: 12px 14px;
            border-radius: 18px;
            background: rgba(255, 255, 255, 0.12);
            border: 1px solid rgba(254, 202, 202, 0.32);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
            position: relative;
            overflow: hidden;
        }

        .app-top-banner-quote::before {
            content: '"';
            position: absolute;
            top: 6px;
            left: 10px;
            font-size: 34px;
            line-height: 1;
            font-weight: 900;
            color: rgba(255, 228, 230, 0.34);
        }

        .app-top-banner-quote-text {
            position: relative;
            padding-left: 14px;
            color: #fff1f2;
            font-size: 11px;
            font-weight: 700;
            line-height: 1.45;
        }

        @media (max-width: 768px) {
            .app-top-banner-mobile-rail {
                flex-direction: column;
                align-items: center;
                gap: 8px;
                width: 58px;
            }

            .app-top-banner-mobile-actions {
                display: flex !important;
                flex-direction: column;
                gap: 6px;
                width: 100%;
                align-items: center;
            }

            .app-top-banner-mobile-btn {
                width: 100%;
                min-width: 0;
                height: 34px;
            }
        }

        body.intro-open #left-sidebar,
        body.intro-open #main-content,
        body.intro-open .mobile-sidebars-toggle,
        body.intro-open .sidebar-toggle-btn {
            filter: blur(18px) saturate(0.82);
            pointer-events: none;
            user-select: none;
            transition: filter 0.35s ease;
        }

        .intro-gateway {
            position: fixed;
            inset: 0;
            z-index: 5200;
            overflow-y: auto;
            padding: 28px;
            background:
                radial-gradient(circle at top left, rgba(253, 224, 71, 0.28), transparent 28%),
                radial-gradient(circle at top right, rgba(20, 184, 166, 0.18), transparent 30%),
                linear-gradient(180deg, rgba(241, 247, 248, 0.98) 0%, rgba(223, 235, 238, 0.98) 100%);
            transition: opacity 0.3s ease, visibility 0.3s ease;
        }

        .intro-gateway.is-hidden {
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
        }

        .intro-gateway::before,
        .intro-gateway::after {
            content: "";
            position: fixed;
            border-radius: 999px;
            filter: blur(0);
            pointer-events: none;
        }

        .intro-gateway::before {
            width: 240px;
            height: 240px;
            right: -60px;
            top: 58px;
            background: radial-gradient(circle, rgba(34, 197, 94, 0.16) 0%, rgba(34, 197, 94, 0) 72%);
        }

        .intro-gateway::after {
            width: 280px;
            height: 280px;
            left: -80px;
            bottom: -80px;
            background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, rgba(14, 165, 233, 0) 72%);
        }

        .intro-shell {
            position: relative;
            z-index: 1;
            width: min(1320px, 100%);
            min-height: calc(100vh - 56px);
            margin: 0 auto;
            display: grid;
            grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
            grid-template-areas:
                "banner banner"
                "main preview";
            gap: 22px;
            align-items: stretch;
            align-content: start;
        }

        .intro-main-panel,
        .intro-preview-card,
        .intro-preview-panel {
            border: 1px solid rgba(203, 213, 225, 0.9);
            background: rgba(255, 255, 255, 0.82);
            box-shadow: 0 20px 48px rgba(148, 163, 184, 0.18);
            backdrop-filter: blur(18px);
        }

        .intro-main-panel {
            grid-area: main;
            border-radius: 34px;
            padding: 34px;
            display: flex;
            flex-direction: column;
            gap: 18px;
            position: relative;
            overflow: hidden;
        }

        .intro-main-panel::before {
            content: "";
            position: absolute;
            inset: 0 0 auto auto;
            width: 220px;
            height: 220px;
            background: radial-gradient(circle, rgba(20, 184, 166, 0.14) 0%, rgba(20, 184, 166, 0) 72%);
            pointer-events: none;
        }

        .intro-hero-banner {
            grid-area: banner;
            width: 100%;
            padding: 14px 18px;
            border-radius: 32px;
            border: 1px solid rgba(191, 219, 254, 0.92);
            background: linear-gradient(180deg, rgba(248, 250, 252, 0.96) 0%, rgba(238, 245, 250, 0.98) 100%);
            box-shadow: 0 18px 34px rgba(148, 163, 184, 0.14);
        }

        .intro-hero-banner .app-top-banner-main {
            align-items: center;
            gap: 18px;
        }

        .intro-hero-banner .app-top-banner-avatar {
            width: 74px;
            height: 74px;
            border-radius: 24px;
        }

        .intro-hero-banner .app-top-banner-copy {
            grid-template-columns: max-content minmax(0, 1fr);
            grid-template-areas:
                "title quote"
                "links quote";
            align-items: center;
            column-gap: 18px;
            row-gap: 10px;
        }

        .intro-hero-banner .app-top-banner-title {
            font-size: 20px;
        }

        .intro-hero-banner .app-top-banner-links {
            gap: 8px;
        }

        .intro-hero-banner .app-top-banner-link {
            min-height: 34px;
            padding: 0 14px;
            font-size: 13px;
        }

        .intro-hero-banner .app-top-banner-quote {
            min-height: 108px;
            border-radius: 24px;
            padding: 18px 20px;
        }

        .intro-hero-banner .app-top-banner-quote::before {
            top: 10px;
            left: 14px;
        }

        .intro-hero-banner .app-top-banner-quote-text {
            padding-left: 22px;
            font-size: 14px;
        }

        .intro-preview-panel {
            grid-area: preview;
        }

        .intro-brand-row {
            display: flex;
            align-items: center;
            gap: 16px;
            min-width: 0;
        }

        .intro-logo-wrap {
            width: 86px;
            height: 86px;
            border-radius: 28px;
            padding: 10px;
            background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(235, 244, 245, 0.92));
            border: 1px solid rgba(203, 213, 225, 0.95);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), 0 16px 28px rgba(14, 165, 233, 0.11);
            flex-shrink: 0;
        }

        .intro-logo-wrap img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            border-radius: 20px;
        }

        .intro-brand-copy {
            display: flex;
            flex-direction: column;
            gap: 4px;
            min-width: 0;
        }

        .intro-kicker {
            font-size: 13px;
            font-weight: 900;
            letter-spacing: 0.16em;
            text-transform: uppercase;
            color: #0f766e;
        }

        .intro-subkicker {
            font-size: 14px;
            font-weight: 700;
            line-height: 1.45;
            color: #475569;
        }

        .intro-status-pill {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            width: fit-content;
            max-width: 100%;
            min-height: 40px;
            padding: 10px 16px;
            border-radius: 999px;
            background: linear-gradient(135deg, rgba(240, 253, 250, 0.96), rgba(236, 254, 255, 0.96));
            border: 1px solid rgba(153, 246, 228, 0.95);
            color: #0f766e;
            font-size: 12px;
            font-weight: 800;
            line-height: 1.4;
        }

        .intro-status-pill i {
            font-size: 13px;
            flex-shrink: 0;
        }

        .intro-title {
            margin: 0;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 8px;
            max-width: none;
            width: 100%;
        }

        .intro-title-main {
            font-family: 'Sora', sans-serif;
            font-size: clamp(24px, 3.2vw, 42px);
            line-height: 1;
            letter-spacing: -0.05em;
            color: #0f172a;
            font-weight: 800;
            white-space: nowrap;
        }

        .intro-title-accent {
            font-family: 'Sora', sans-serif;
            position: relative;
            display: inline-block;
            max-width: 100%;
            padding: 0 0 10px;
            font-size: clamp(12px, 1.1vw, 16px);
            line-height: 1.2;
            letter-spacing: -0.02em;
            color: #0f766e;
            font-weight: 700;
            white-space: nowrap;
        }

        .intro-title-accent::after {
            content: "";
            position: absolute;
            left: 0;
            bottom: 0;
            width: 100%;
            height: 3px;
            border-radius: 999px;
            background: linear-gradient(90deg, rgba(20, 184, 166, 0.95), rgba(59, 130, 246, 0.35));
        }

        .intro-description {
            margin: 0;
            max-width: 68ch;
            color: #334155;
            font-size: 15px;
            font-weight: 600;
            line-height: 1.8;
        }

        .intro-chip-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }

        .intro-chip {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            min-height: 42px;
            padding: 0 14px;
            border-radius: 16px;
            background: rgba(248, 250, 252, 0.94);
            border: 1px solid rgba(226, 232, 240, 0.95);
            color: #334155;
            font-size: 12px;
            font-weight: 800;
            line-height: 1.3;
        }

        .intro-chip i {
            color: #0ea5a4;
            font-size: 13px;
        }

        .intro-action-row {
            display: flex;
            flex-wrap: nowrap;
            gap: 12px;
            margin-top: 6px;
        }

        .intro-action-btn {
            flex: 1 1 0;
            min-width: 0;
            min-height: 54px;
            padding: 10px 14px;
            border-radius: 18px;
            border: none;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            font-size: 14px;
            font-weight: 900;
            line-height: 1.1;
            letter-spacing: 0.01em;
            transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
            text-align: center;
        }

        .intro-action-btn span {
            line-height: 1.2;
        }

        .intro-action-btn:hover {
            transform: translateY(-2px);
        }

        .intro-action-primary {
            color: #ffffff;
            background: linear-gradient(135deg, #0f766e 0%, #0ea5a4 100%);
            box-shadow: 0 18px 28px rgba(15, 118, 110, 0.24);
        }

        .intro-action-secondary {
            color: #0f172a;
            background: rgba(255, 255, 255, 0.96);
            border: 1px solid rgba(203, 213, 225, 0.95);
            box-shadow: 0 16px 26px rgba(148, 163, 184, 0.15);
        }

        .intro-install-status {
            min-height: 44px;
            padding: 12px 16px;
            border-radius: 18px;
            background: linear-gradient(135deg, rgba(248, 250, 252, 0.94), rgba(240, 249, 255, 0.94));
            border: 1px solid rgba(191, 219, 254, 0.92);
            color: #334155;
            font-size: 12px;
            font-weight: 800;
            line-height: 1.6;
        }

        .intro-preview-panel {
            border-radius: 34px;
            padding: 20px;
            display: flex;
            flex-direction: column;
            gap: 16px;
            background: linear-gradient(180deg, rgba(250, 253, 253, 0.86), rgba(239, 246, 248, 0.9));
        }

        .intro-preview-card {
            border-radius: 28px;
            padding: 22px;
            overflow: hidden;
        }

        .intro-preview-row {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 16px;
        }

        .intro-preview-row > .intro-preview-card:only-child {
            grid-column: 1 / -1;
        }

        .intro-preview-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 18px;
        }

        .intro-preview-eyebrow {
            font-size: 11px;
            font-weight: 900;
            letter-spacing: 0.16em;
            text-transform: uppercase;
            color: #0ea5a4;
            margin-bottom: 6px;
        }

        .intro-preview-title {
            font-size: 24px;
            font-weight: 900;
            line-height: 1.08;
            color: #0f172a;
            letter-spacing: -0.04em;
            max-width: 12ch;
        }

        .intro-preview-badge {
            flex-shrink: 0;
            min-height: 34px;
            padding: 0 12px;
            border-radius: 999px;
            background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(14, 165, 233, 0.16));
            color: #0f766e;
            border: 1px solid rgba(167, 243, 208, 0.9);
            font-size: 11px;
            font-weight: 900;
            display: inline-flex;
            align-items: center;
        }

        .intro-stat-grid {
            display: grid;
            grid-template-columns: repeat(5, minmax(0, 1fr));
            gap: 10px;
            margin-bottom: 18px;
        }

        .intro-stat-card {
            min-height: 96px;
            padding: 14px 12px;
            border-radius: 20px;
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 245, 249, 0.96));
            border: 1px solid rgba(226, 232, 240, 0.94);
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            gap: 10px;
        }

        .intro-stat-card strong {
            font-size: 28px;
            font-weight: 900;
            color: #0f172a;
            line-height: 1;
        }

        .intro-stat-card span {
            font-size: 11px;
            font-weight: 800;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 0.08em;
        }

        .intro-feature-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .intro-feature-item {
            display: grid;
            grid-template-columns: 44px minmax(0, 1fr);
            gap: 12px;
            align-items: flex-start;
            min-height: 74px;
            padding: 14px;
            border-radius: 22px;
            background: rgba(248, 250, 252, 0.9);
            border: 1px solid rgba(226, 232, 240, 0.92);
        }

        .intro-feature-item i {
            width: 44px;
            height: 44px;
            border-radius: 14px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, rgba(15, 118, 110, 0.16), rgba(14, 165, 233, 0.16));
            color: #0f766e;
            font-size: 17px;
        }

        .intro-feature-item strong {
            display: block;
            margin-bottom: 5px;
            color: #0f172a;
            font-size: 14px;
            font-weight: 900;
        }

        .intro-feature-item span {
            color: #475569;
            font-size: 12px;
            font-weight: 700;
            line-height: 1.55;
        }

        .intro-mini-title {
            margin-bottom: 12px;
            color: #0f172a;
            font-size: 16px;
            font-weight: 900;
            letter-spacing: -0.03em;
        }

        .intro-mini-list {
            margin: 0;
            padding-left: 18px;
            display: grid;
            gap: 10px;
            color: #475569;
            font-size: 12px;
            font-weight: 700;
            line-height: 1.6;
        }

        .intro-preview-row > .intro-preview-card:only-child .intro-mini-list {
            grid-template-columns: repeat(2, minmax(0, 1fr));
            column-gap: 28px;
            row-gap: 12px;
        }

        .install-helper-modal[hidden] {
            display: none !important;
        }

        .install-helper-modal {
            position: fixed;
            inset: 0;
            z-index: 5300;
        }

        .install-helper-backdrop {
            position: absolute;
            inset: 0;
            background: rgba(15, 23, 42, 0.48);
            backdrop-filter: blur(8px);
        }

        .install-helper-dialog {
            position: relative;
            z-index: 1;
            width: min(560px, calc(100vw - 24px));
            margin: 8vh auto 0;
            border-radius: 28px;
            padding: 26px;
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.98));
            border: 1px solid rgba(226, 232, 240, 0.95);
            box-shadow: 0 28px 60px rgba(15, 23, 42, 0.2);
        }

        .install-helper-close {
            position: absolute;
            top: 14px;
            right: 14px;
            width: 36px;
            height: 36px;
            border-radius: 999px;
            border: 1px solid rgba(203, 213, 225, 0.95);
            background: #ffffff;
            color: #475569;
            cursor: pointer;
        }

        .install-helper-icon {
            width: 72px;
            height: 72px;
            padding: 8px;
            border-radius: 24px;
            background: linear-gradient(145deg, #ffffff, #ecfeff);
            border: 1px solid rgba(191, 219, 254, 0.94);
            box-shadow: 0 14px 30px rgba(14, 165, 233, 0.12);
            margin-bottom: 12px;
        }

        .install-helper-icon img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            border-radius: 18px;
        }

        .install-helper-label {
            color: #0f766e;
            font-size: 11px;
            font-weight: 900;
            text-transform: uppercase;
            letter-spacing: 0.16em;
            margin-bottom: 10px;
        }

        .install-helper-title {
            margin: 0 0 10px;
            color: #0f172a;
            font-size: 28px;
            font-weight: 900;
            line-height: 1.05;
            letter-spacing: -0.04em;
        }

        .install-helper-text {
            margin: 0 0 14px;
            color: #475569;
            font-size: 14px;
            font-weight: 700;
            line-height: 1.7;
        }

        .install-helper-steps {
            margin: 0;
            padding-left: 20px;
            display: grid;
            gap: 10px;
            color: #334155;
            font-size: 13px;
            font-weight: 700;
            line-height: 1.7;
        }

        @media (max-width: 980px) {
            .intro-gateway {
                padding: 18px;
            }

            .intro-shell {
                min-height: auto;
                grid-template-columns: 1fr;
                grid-template-areas:
                    "banner"
                    "main"
                    "preview";
            }

            .intro-title {
                max-width: none;
            }

            .intro-preview-row {
                grid-template-columns: 1fr;
            }

            .intro-preview-row > .intro-preview-card:only-child .intro-mini-list {
                grid-template-columns: 1fr;
            }

            .intro-stat-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
        }

        @media (max-width: 640px) {
            .intro-gateway {
                padding: 10px 10px 18px;
            }

            .intro-shell {
                gap: 14px;
            }

            .intro-main-panel,
            .intro-preview-panel,
            .intro-preview-card,
            .install-helper-dialog {
                border-radius: 26px;
            }

            .intro-main-panel,
            .intro-preview-panel {
                padding: 16px;
                gap: 14px;
            }

            .intro-preview-card {
                padding: 16px;
            }

            .intro-brand-row {
                display: grid;
                grid-template-columns: 60px minmax(0, 1fr);
                align-items: center;
                gap: 12px;
            }

            .intro-hero-banner {
                padding: 14px 14px 12px;
                border-radius: 24px;
            }

            .intro-hero-banner .app-top-banner-main {
                flex-direction: column;
                align-items: stretch;
                gap: 12px;
            }

            .intro-hero-banner .app-top-banner-avatar {
                width: 58px;
                height: 58px;
                border-radius: 18px;
            }

            .intro-hero-banner .app-top-banner-copy {
                display: grid;
                grid-template-columns: 1fr;
                grid-template-areas:
                    "title"
                    "links"
                    "quote";
                align-items: stretch;
                row-gap: 10px;
                max-width: none;
            }

            .intro-hero-banner .app-top-banner-title {
                font-size: 15px;
            }

            .intro-hero-banner .app-top-banner-links {
                width: 100%;
                justify-content: flex-start;
                flex-wrap: nowrap;
                gap: 6px;
                overflow-x: auto;
            }

            .intro-hero-banner .app-top-banner-link {
                min-height: 30px;
                padding: 0 12px;
                font-size: 10.5px;
            }

            .intro-hero-banner .app-top-banner-quote {
                min-height: auto;
                padding: 12px 14px;
                border-radius: 18px;
            }

            .intro-hero-banner .app-top-banner-quote-text {
                padding-left: 14px;
                font-size: 11px;
                line-height: 1.55;
            }

            .intro-logo-wrap {
                width: 60px;
                height: 60px;
                border-radius: 18px;
            }

            .intro-kicker {
                font-size: 10px;
                letter-spacing: 0.12em;
            }

            .intro-subkicker {
                font-size: 11px;
                line-height: 1.45;
            }

            .intro-status-pill {
                width: 100%;
                border-radius: 18px;
                padding: 12px 14px;
                font-size: 11.5px;
            }

            .intro-title {
                gap: 6px;
            }

            .intro-title-main {
                font-size: clamp(18px, 5.8vw, 22px);
                line-height: 1.03;
            }

            .intro-title-accent {
                padding-bottom: 6px;
                font-size: 10.5px;
            }

            .intro-chip-grid {
                display: grid;
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 8px;
            }

            .intro-chip {
                width: auto;
                min-height: 54px;
                padding: 12px;
                border-radius: 16px;
                font-size: 10.5px;
                line-height: 1.35;
                align-items: flex-start;
                justify-content: flex-start;
                text-align: left;
            }

            .intro-action-row {
                display: grid;
                grid-template-columns: repeat(3, minmax(0, 1fr));
                gap: 8px;
            }

            .intro-action-btn {
                width: 100%;
                min-height: 88px;
                padding: 12px 8px;
                border-radius: 18px;
                flex-direction: column;
                gap: 8px;
                font-size: 10px;
                line-height: 1.15;
                justify-content: center;
            }

            .intro-action-btn i {
                font-size: 16px;
            }

            .intro-action-btn span {
                white-space: normal;
                text-wrap: balance;
            }

            .intro-install-status {
                border-radius: 16px;
                font-size: 11px;
            }

            .intro-preview-title {
                font-size: 20px;
                max-width: none;
            }

            .intro-preview-badge {
                min-height: 30px;
                font-size: 10px;
            }

            .intro-stat-card {
                min-height: 84px;
                padding: 12px;
                border-radius: 18px;
            }

            .intro-stat-card strong {
                font-size: 22px;
            }

            .intro-stat-grid > .intro-stat-card:last-child {
                grid-column: 1 / -1;
            }

            .intro-feature-item {
                grid-template-columns: 40px minmax(0, 1fr);
                min-height: auto;
                padding: 12px;
                border-radius: 18px;
                gap: 10px;
            }

            .intro-feature-item i {
                width: 40px;
                height: 40px;
                border-radius: 12px;
                font-size: 15px;
            }

            .intro-feature-item strong {
                font-size: 13px;
            }

            .intro-feature-item span {
                font-size: 11.5px;
            }

            .intro-preview-row {
                gap: 12px;
            }

            .intro-mini-title {
                font-size: 15px;
                margin-bottom: 10px;
            }

            .intro-mini-list {
                font-size: 11.2px;
                gap: 9px;
            }

            .install-helper-dialog {
                margin-top: 20px;
                padding: 18px;
            }

            .install-helper-title {
                font-size: 24px;
            }

            .install-helper-text,
            .install-helper-steps {
                font-size: 12px;
            }
        }

        @media (max-width: 420px) {
            .intro-title-main {
                font-size: 17px;
            }

            .intro-title-accent {
                font-size: 10px;
            }

            .intro-action-btn {
                min-height: 82px;
                padding: 10px 6px;
                font-size: 9.5px;
            }

            .intro-action-btn i {
                font-size: 15px;
            }
        }

        /* Social Panel Styles */
        .socials-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            z-index: 9998;
        }

        .socials-overlay.active {
            display: block;
        }

        .socials-modern-panel {
            display: none;
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 400px;
            max-width: 90%;
            background: white;
            border-radius: 20px;
            padding: 25px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            z-index: 9999;
            max-height: 80vh;
            overflow-y: auto;
        }

        .socials-modern-panel.active {
            display: block;
        }

        .close-socials-btn {
            position: absolute;
            top: 15px;
            right: 15px;
            background: none;
            border: none;
            color: #666;
            font-size: 18px;
            cursor: pointer;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s;
        }

        .close-socials-btn:hover {
            background: #f1f5f9;
            color: #333;
        }

        .socials-modern-header {
            font-size: 18px;
            font-weight: 900;
            color: #4f46e5;
            margin-bottom: 15px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .socials-creator {
            font-size: 12px;
            color: #666;
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 2px solid #f1f5f9;
            text-align: center;
        }

        .socials-category {
            font-size: 14px;
            font-weight: 800;
            color: #333;
            margin: 15px 0 10px;
            padding-left: 5px;
        }

        .social-link-modern {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 15px;
            background: #f8fafc;
            border-radius: 12px;
            margin-bottom: 8px;
            color: #475569;
            text-decoration: none;
            transition: all 0.3s;
            border: 2px solid transparent;
        }

        .social-link-modern:hover {
            background: white;
            border-color: #4f46e5;
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(79, 70, 229, 0.15);
            color: #4f46e5;
        }

        .social-link-modern i {
            width: 20px;
            text-align: center;
            font-size: 18px;
        }

        /* Sidebar Toggle Button */
        .sidebar-toggle-btn {
            position: fixed;
            top: calc(var(--app-top-banner-height, 96px) + 6px);
            left: 20px;
            z-index: 1000;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: linear-gradient(135deg, #475569 0%, #334155 100%);
            color: white;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            box-shadow: 0 8px 25px rgba(51, 65, 85, 0.3);
            transition: all 0.3s;
        }

        .sidebar-toggle-btn:hover {
            transform: scale(1.1);
            box-shadow: 0 12px 30px rgba(51, 65, 85, 0.45);
        }

        .mobile-sidebar-overlay {
            display: none;
        }

        .sidebar-hidden {
            transform: translateX(-100%);
            width: 0 !important;
            min-width: 0 !important;
            overflow: hidden;
            border: 0 !important;
            padding: 0 !important;
        }

        .right-sidebar-hidden {
            transform: translateX(100%);
        }

        .main-expanded {
            margin-left: var(--app-left-sidebar-width, 78px) !important;
        }

        .terminate-btn-quiz {
            background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
            color: white;
            padding: 15px 30px;
            border-radius: 12px;
            font-size: 16px;
            font-weight: 900;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 12px;
            box-shadow: 0 12px 25px rgba(239, 68, 68, 0.3);
            transition: all 0.3s;
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-top: 30px;
            width: 100%;
            justify-content: center;
        }

        .socials-sidebar-btn {
            background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
            color: white;
            padding: 15px;
            border-radius: 15px;
            font-size: 14px;
            font-weight: 800;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 12px;
            box-shadow: 0 12px 25px rgba(139, 92, 246, 0.3);
            transition: all 0.3s;
            backdrop-filter: blur(10px);
            border: 2px solid rgba(255, 255, 255, 0.2);
            margin: 15px 0;
        }

        .socials-sidebar-btn:hover {
            transform: translateY(-3px) scale(1.03);
            box-shadow: 0 15px 30px rgba(139, 92, 246, 0.5);
        }

        .setup-filters {
            /* single compact row */
            display: flex;
            flex-wrap: nowrap;
            align-items: flex-start;
            gap: 8px;
            margin-bottom: 10px;
            padding: 10px;
            background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
            border-radius: 16px;
            border: 1px solid rgba(255, 255, 255, 0.18);
            box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
            position: relative;
            z-index: 10;
            overflow: visible;
        }

        /* Each filter in a rounded "pill" with its own light modern color */
        .setup-filters .filter-group {
            flex: 1 1 0;
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 6px;
            padding: 8px 12px;
            border-radius: 12px;
            border: 1px solid rgba(255, 255, 255, 0.3);
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            background: rgba(255, 255, 255, 0.7);
            position: relative;
            z-index: 15;
            overflow: visible;
        }

        .setup-filters .filter-group label {
            margin: 0;
            font-size: 11px;
            line-height: 1.2;
            font-weight: 700;
            letter-spacing: 0.3px;
            white-space: nowrap;
            opacity: 0.9;
            color: #2d3748;
        }

        /* Compact rounded selects inside pills */
        .setup-filters .filter-group select,
        #years-dropdown,
        #rotations-dropdown,
        #faculty-dropdown,
        #global-language-filter {
            width: auto !important;
            max-width: 180px !important;
            padding: 6px 12px !important;
            font-size: 11px !important;
            height: 28px !important;
            border-radius: 8px !important;
            background: rgba(255, 255, 255, 0.85) !important;
            border: 1px solid rgba(255, 255, 255, 0.3) !important;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
            transition: all 0.3s ease !important;
            color: #2d3748 !important;
            font-weight: 500 !important;
        }

        .setup-filters .filter-group select:focus,
        #years-dropdown:focus,
        #rotations-dropdown:focus,
        #faculty-dropdown:focus,
        #global-language-filter:focus {
            border-color: #8b5cf6 !important;
            outline: none !important;
            box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2), 0 2px 8px rgba(139, 92, 246, 0.15) !important;
            background: rgba(255, 255, 255, 0.95) !important;
            transform: translateY(-1px) !important;
            z-index: 25 !important;
            position: relative !important;
        }

        .setup-filters .filter-group select:hover,
        #years-dropdown:hover,
        #rotations-dropdown:hover,
        #faculty-dropdown:hover,
        #global-language-filter:hover {
            background: rgba(255, 255, 255, 0.9) !important;
            transform: translateY(-1px) !important;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08) !important;
        }

        /* Custom multi-select dropdowns (rounded + checkboxes) */
        .multi-select {
            position: relative;
            min-width: 0;
            width: 100%;
            z-index: 50;
            margin-top: 2px;
        }

        .ms-btn {
            width: 100%;
            height: 16px;
            padding: 0 4px;
            border-radius: 4px;
            border: 1px solid rgba(255, 255, 255, 0.3);
            background: rgba(255, 255, 255, 0.85);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            font-size: 8px;
            font-weight: 500;
            color: #2d3748;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 2px;
            cursor: pointer;
            transition: all 0.15s ease;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
        }

        .ms-btn:hover {
            background: rgba(255, 255, 255, 0.95);
            transform: translateY(-0.5px);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
        }

        .ms-btn.active {
            background: rgba(255, 255, 255, 0.95);
            border-color: rgba(139, 92, 246, 0.3);
            box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.1);
        }

        .ms-btn span {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            flex-grow: 1;
        }

        .ms-btn i {
            transition: transform 0.15s ease;
            font-size: 8px;
            opacity: 0.7;
        }

        .ms-btn.active i {
            transform: rotate(180deg);
        }

        .ms-panel {
            position: absolute;
            left: 0;
            top: calc(100% + 2px);
            width: 180px;
            max-width: 50vw;
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            border: 1px solid rgba(255, 255, 255, 0.3);
            border-radius: 8px;
            box-shadow: 0 4px 16px rgba(31, 38, 135, 0.15);
            padding: 6px;
            z-index: 500;
            display: none;
            overflow: hidden;
            transform-origin: top center;
            animation: dropdownOpen 0.15s ease-out forwards;
            margin-top: 0;
        }

        @keyframes dropdownOpen {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .ms-panel.open {
            display: block;
        }

        .ms-list {
            max-height: 180px;
            overflow: auto;
            padding: 2px;
            scrollbar-width: thin;
            scrollbar-color: rgba(139, 92, 246, 0.2) transparent;
        }

        .ms-list::-webkit-scrollbar {
            width: 4px;
        }

        .ms-list::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.03);
            border-radius: 6px;
        }

        .ms-list::-webkit-scrollbar-thumb {
            background-color: rgba(139, 92, 246, 0.2);
            border-radius: 6px;
        }

        .ms-list::-webkit-scrollbar-thumb:hover {
            background-color: rgba(139, 92, 246, 0.3);
        }

        .ms-item {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 6px 8px;
            border-radius: 6px;
            font-size: 11px;
            font-weight: 500;
            cursor: pointer;
            user-select: none;
            transition: all 0.15s ease;
            color: #2d3748;
        }

        .ms-item:hover {
            background: rgba(139, 92, 246, 0.06);
            transform: translateX(1px);
        }

        .ms-item.selected {
            background: rgba(139, 92, 246, 0.08);
        }

        .ms-item input {
            width: 12px;
            height: 12px;
            accent-color: #8b5cf6;
            cursor: pointer;
        }

        /* Per-list light colors */
        #years-ms .ms-item {
            background: #ecfdf5;
            color: #064e3b;
        }

        #rotations-ms .ms-item {
            background: #fffbeb;
            color: #78350f;
        }

        #faculty-ms .ms-item {
            background: #faf5ff;
            color: #581c87;
        }

        #languages-ms .ms-item {
            background: #eff6ff;
            color: #1e3a8a;
        }

        /* Remove native option styling (no longer used) */

        /* Color themes per filter (based on their order in the DOM) */
        .setup-filters .filter-group:nth-child(1) {
            background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
        }

        .setup-filters .filter-group:nth-child(1) label {
            color: #14532d;
        }

        .setup-filters .filter-group:nth-child(2) {
            background: linear-gradient(135deg, #fffbeb 0%, #fde68a 100%);
        }

        .setup-filters .filter-group:nth-child(2) label {
            color: #78350f;
        }

        .setup-filters .filter-group:nth-child(3) {
            background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
        }

        .setup-filters .filter-group:nth-child(3) label {
            color: #581c87;
        }

        .setup-filters .filter-group:nth-child(4) {
            background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
        }

        .setup-filters .filter-group:nth-child(4) label {
            color: #0c4a6e;
        }

        /* Ultra-compact main filtering menu (Années/Rotations/Facultés/Langue) */
        .setup-filters .filter-group {
            gap: 4px;
        }

        .setup-filters .filter-group label {
            margin: 0;
            font-size: 10px;
            line-height: 1;
        }

        .setup-filters .filter-options {
            gap: 3px;
        }

        .setup-filters .filter-option {
            gap: 3px;
            font-size: 10px;
            line-height: 1;
            padding: 0;
            margin: 0;
        }

        .setup-filters .filter-option input {
            width: 11px;
            height: 11px;
        }

        /* shrink dropdowns in the main filters */
        .setup-filters .filter-group select,
        #years-dropdown,
        #rotations-dropdown,
        #faculty-dropdown,
        #global-language-filter {
            max-width: 140px !important;
            padding: 2px 8px !important;
            font-size: 10px !important;
            height: 26px !important;
        }

        /* keep them usable on mobile */
        @media (max-width: 768px) {
            .setup-filters {
                /* on mobile keep them stacked for readability */
                flex-direction: column;
                gap: 6px !important;
                padding: 10px !important;
                margin-bottom: 10px !important;
            }

            .setup-filters .filter-group label {
                font-size: 12px !important;
            }

            .setup-filters .filter-group select,
            #years-dropdown,
            #rotations-dropdown,
            #faculty-dropdown,
            #global-language-filter {
                width: 100% !important;
                max-width: none !important;
                padding: 8px 12px !important;
                height: 38px !important;
                font-size: 13px !important;
            }
        }

        .filter-group {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .filter-group label {
            font-size: 14px;
            font-weight: 800;
            color: #4f46e5;
            margin-bottom: 5px;
        }

        .filter-options {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }

        /* Design pill/chip pour les listes du panneau de filtrage (Années, Rotations, Facultés, Langue) */
        .setup-filters .filter-group select,
        #years-dropdown,
        #rotations-dropdown,
        #faculty-dropdown,
        #global-language-filter {
            width: auto !important;
            max-width: 180px !important;
            padding: 6px 14px !important;
            font-size: 12px !important;
            height: 34px !important;
            border-radius: 9999px !important;
            background: linear-gradient(90deg, rgba(239, 246, 255, 1), rgba(237, 255, 250, 1));
            color: #0f172a !important;
            border: 1px solid rgba(99, 102, 241, 0.12) !important;
            box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04) !important;
            font-weight: 700 !important;
            -webkit-appearance: none !important;
            appearance: none !important;
            padding-right: 36px !important;
            position: relative;
        }

        /* Masquer le chevron natif sur certains navigateurs */
        .setup-filters .filter-group select::-ms-expand {
            display: none;
        }

        /* Arrow décoratif (simple) */
        .setup-filters .filter-group select {
            background-image: linear-gradient(45deg, transparent 50%, rgba(15, 23, 42, 0.5) 50%), linear-gradient(135deg, rgba(15, 23, 42, 0.5) 50%, transparent 50%);
            background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
            background-size: 6px 6px, 6px 6px;
            background-repeat: no-repeat;
        }

        /* Sur petits écrans, conserver largeur complète pour lisibilité */
        @media (max-width: 768px) {

            .setup-filters .filter-group select,
            #years-dropdown,
            #rotations-dropdown,
            #faculty-dropdown,
            #global-language-filter {
                width: 100% !important;
                max-width: none !important;
            }
        }

        /* Multi-select visuals: allow scrolling when multiple options shown */
        .setup-filters .filter-group select[multiple] {
            height: auto !important;
            max-height: 140px !important;
            overflow-y: auto !important;
            padding: 8px !important;
            border-radius: 12px !important;
            background: #fff !important;
            color: #0f172a !important;
            box-shadow: 0 8px 20px rgba(2, 6, 23, 0.04) !important;
        }

        /* chips removed: using single-select dropdowns for years & rotations */

        .filter-option {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 13px;
            color: #475569;
            white-space: nowrap;
        }

        .filter-option input {
            width: 14px;
            height: 14px;
            cursor: pointer;
            accent-color: #4f46e5;
        }

        /* Corrected color classes for options */
        .opt-btn {
            width: 100%;
            text-align: left;
            padding: 8px 10px;
            border: 2px solid #e2e8f0;
            border-radius: 13px;
            display: flex;
            align-items: center;
            gap: 8px;
            background: white;
            transition: all 0.3s;
            margin-bottom: 4px;
            cursor: pointer;
            font-size: 12px;
            position: relative;
            --option-actions-space: 104px;
            --option-strikethrough-start: 22px;
        }

        .opt-id {
            min-width: 28px;
            height: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 10px;
            font-weight: 900;
            font-size: 11px;
            color: #94a3b8;
            background: #f1f5f9;
            flex-shrink: 0;
        }

        .opt-text {
            font-size: 12px;
            font-weight: 700;
            color: #475569;
            flex: 1;
            user-select: text;
            cursor: text;
            line-height: 1.25;
        }

        .opt-item-wrap {
            position: relative;
            margin-bottom: 3px;
        }

        .opt-item-wrap .opt-btn {
            margin-bottom: 0 !important;
            padding-right: 104px !important;
            --option-actions-space: 104px;
        }

        .opt-inline-actions {
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            display: flex;
            align-items: center;
            gap: 3px;
            z-index: 6;
        }

        /* زر X لحذف الاقتراح */
        .opt-delete-btn {
            width: 22px;
            height: 22px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1px solid #fecaca;
            background: #fff5f5;
            color: #ef4444;
            border-radius: 9999px;
            font-size: 13px;
            font-weight: 900;
            line-height: 1;
            cursor: pointer;
            transition: all 0.2s ease;
            padding: 0;
        }

        .opt-delete-btn:hover {
            background: #fee2e2;
            transform: scale(1.06);
        }

        .option-justification-btn {
            height: 20px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1px solid #cbd5e1;
            background: #f8fafc;
            color: #334155;
            border-radius: 9999px;
            padding: 0 6px;
            font-size: 8px;
            font-weight: 800;
            line-height: 1.1;
            cursor: pointer;
            transition: all 0.2s ease;
            white-space: nowrap;
        }

        .option-justification-btn:hover {
            background: #eef2ff;
            border-color: #a5b4fc;
            color: #3730a3;
        }

        .option-justification-btn.active {
            background: #eef2ff;
            border-color: #818cf8;
            color: #3730a3;
        }

        /* نص مشطوب */
        .strikethrough {
            color: #94a3b8 !important;
        }

        .opt-btn.strikethrough {
            position: relative;
        }

        .opt-btn.strikethrough::after {
            content: "";
            position: absolute;
            left: var(--option-strikethrough-start);
            right: calc(var(--option-actions-space) - 8px);
            top: 50%;
            border-top: 3px solid #ef4444;
            transform: translateY(-50%);
            z-index: 5;
            pointer-events: none;
        }

        .opt-btn.strikethrough .opt-id,
        .opt-btn.strikethrough .opt-text {
            position: relative;
            z-index: 2;
            color: #94a3b8 !important;
        }

        .opt-btn.strikethrough .opt-id {
            background: #f8fafc;
            border: 1px solid #fecaca;
        }

        .opt-btn.strikethrough .opt-id::after {
            content: none;
        }

        /* Evaluation Styles */
        .evaluation-container {
            display: flex;
            flex-direction: column;
            gap: 5px;
            align-items: center;
            margin: 10px 0;
            width: 100%;
        }

        .evaluation-row {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .evaluation-label {
            font-size: 11px;
            font-weight: bold;
            color: #64748b;
            width: 100px;
            text-align: right;
        }

        /* Revision Header Styles */
        .révision-header-controls {
            display: flex;
            align-items: center;
            gap: 8px;
            flex: 1;
            justify-content: flex-end;
            flex-wrap: wrap;
        }

        .révision-filter-select {
            padding: 4px 8px;
            border-radius: 15px;
            border: 1px solid rgba(255, 255, 255, 0.3);
            background: rgba(255, 255, 255, 0.2);
            color: white;
            font-size: 10px;
            font-weight: bold;
            outline: none;
            cursor: pointer;
            max-width: 120px;
        }

        .révision-filter-select option {
            background: white;
            color: #333;
        }

        .révision-test-btn-small {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            color: white;
            padding: 5px 15px;
            border-radius: 15px;
            font-weight: bold;
            font-size: 10px;
            border: none;
            cursor: pointer;
            transition: all 0.3s;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
            text-transform: uppercase;
        }

        .révision-test-btn-small:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .révision-test-btn-small:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
        }

        /* Correct: Selected and correct - GREEN */
        .correct {
            border-color: #15803d !important;
            background: linear-gradient(135deg, rgba(34, 197, 94, 0.16) 0%, rgba(22, 163, 74, 0.16) 100%) !important;
            color: #166534 !important;
            box-shadow: 0 0 0 1px rgba(21, 128, 61, 0.08);
        }

        .correct .opt-text {
            color: #166534 !important;
        }

        .correct .opt-id {
            background: #dcfce7 !important;
            color: #166534 !important;
            border: 1px solid #86efac;
        }

        /* Wrong: Selected and incorrect - RED */
        .wrong {
            border-color: #ef4444 !important;
            background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.15) 100%) !important;
            color: #b91c1c !important;
            box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.08);
        }

        .wrong .opt-text {
            color: #b91c1c !important;
        }

        .wrong .opt-id {
            background: #fee2e2 !important;
            color: #b91c1c !important;
            border: 1px solid #fecaca;
        }

        .correct-wrong-split {
            border: 2px solid transparent !important;
            background:
                linear-gradient(90deg, rgba(254, 226, 226, 0.96) 0%, rgba(254, 202, 202, 0.96) 50%, rgba(220, 252, 231, 0.96) 50%, rgba(187, 247, 208, 0.96) 100%) padding-box,
                linear-gradient(90deg, #ef4444 0%, #ef4444 50%, #16a34a 50%, #16a34a 100%) border-box !important;
            color: #14532d !important;
            box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.04);
        }

        .correct-wrong-split .opt-text {
            color: #14532d !important;
        }

        .correct-wrong-split .opt-id {
            background: linear-gradient(180deg, #fee2e2 0%, #fecaca 100%) !important;
            color: #7f1d1d !important;
            border: 1px solid #fca5a5;
        }

        /* Missed: Correct but not selected - YELLOW */
        .missed {
            border-color: #b45309 !important;
            background: linear-gradient(135deg, rgba(251, 191, 36, 0.18) 0%, rgba(245, 158, 11, 0.16) 100%) !important;
            color: #92400e !important;
            box-shadow: 0 0 0 1px rgba(180, 83, 9, 0.08);
        }

        .missed .opt-text {
            color: #92400e !important;
        }

        .missed .opt-id {
            background: #fef3c7 !important;
            color: #92400e !important;
            border: 1px solid #fcd34d;
        }

        .justification-bubble {
            margin-bottom: 12px;
            margin-left: 40px;
            padding: 10px 15px;
            border-radius: 0 15px 15px 15px;
            font-size: 12px;
            font-weight: 600;
            display: none;
            background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
            color: #475569;
            border-left: 4px solid #cbd5e1;
        }

        .justification-bubble.is-visible {
            display: block;
        }

        .corrected .opt-id {
            visibility: visible !important;
        }

        #study-modal {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.8);
            z-index: 3000;
            align-items: center;
            justify-content: center;
            padding: 0;
        }

        #study-container {
            display: flex;
            flex: 1 1 auto;
            flex-direction: row;
            min-width: 0;
            min-height: 0;
        }

        #course-container {
            order: 1;
            width: 50%;
            flex: 1 1 50%;
            min-width: 0;
            min-height: 0;
            overflow: hidden;
            border-left: none !important;
            border-right: 1px solid #e5e7eb;
        }

        #quiz-container {
            order: 2;
            width: 50%;
            flex: 1 1 50%;
            min-width: 0;
            min-height: 0;
            overflow: auto;
        }

        #course-container iframe {
            display: block;
            width: 100%;
            height: 100%;
        }

        #study-quiz-content {
            min-height: 100%;
            box-sizing: border-box;
        }

        .hide-id .opt-id {
            visibility: hidden;
        }

        .nav-correct {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
            color: white !important;
        }

        .nav-wrong {
            background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
            color: white !important;
        }

        .nav-unanswered {
            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
            color: white !important;
        }

        .general-explanation {
            display: none;
            margin-top: 20px;
            padding: 15px;
            background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
            border-radius: 15px;
            border-left: 6px solid #3b82f6;
            font-size: 14px;
            line-height: 1.5;
            color: #475569;
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
        }

        .general-explanation.active {
            display: block;
        }

        .question-filters {
            display: flex;
            gap: 10px;
            margin-bottom: 15px;
            flex-wrap: wrap;
            position: relative;
            z-index: 100;
        }

        .filter-badge {
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: bold;
            display: flex;
            align-items: center;
            gap: 6px;
            cursor: pointer;
            transition: all 0.3s;
            position: relative;
            z-index: 101;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
            min-width: 0;
            max-width: 100%;
        }

        .filter-badge-label {
            flex: 1 1 auto;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            display: block;
        }

        .filter-badge:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
        }

        .filter-module {
            background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
            color: #1e40af;
        }

        .filter-lesson {
            background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
            color: #3730a3;
        }

        .filter-rotation {
            background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
            color: #92400e;
        }

        .filter-year {
            background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
            color: #166534;
        }

        .filter-faculty {
            background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
            color: #6b21a8;
        }

        .loading {
            display: none;
            text-align: center;
            padding: 25px;
            color: #64748b;
        }

        .qcm-catalog-loader {
            position: relative;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            gap: 14px;
            padding: 24px;
            border-radius: 24px;
            border: 1px solid rgba(148, 163, 184, 0.22);
            background:
                radial-gradient(circle at top right, rgba(14, 165, 233, 0.12), transparent 42%),
                linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
            box-shadow: 0 16px 48px rgba(15, 23, 42, 0.08);
        }

        .qcm-catalog-loader::before {
            content: "";
            position: absolute;
            inset: 0;
            background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.55) 40%, transparent 72%);
            transform: translateX(-100%);
            animation: qcmCatalogSweep 2.2s linear infinite;
            pointer-events: none;
        }

        .qcm-catalog-loader.is-ready::before {
            display: none;
        }

        .qcm-catalog-loader-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
        }

        .qcm-catalog-loader-title {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 16px;
            font-weight: 900;
            color: #0f172a;
        }

        .qcm-catalog-loader-title i {
            color: #0284c7;
        }

        .qcm-catalog-loader-badge {
            min-width: 72px;
            padding: 8px 14px;
            border-radius: 999px;
            text-align: center;
            font-size: 12px;
            font-weight: 900;
            color: #0369a1;
            background: rgba(14, 165, 233, 0.12);
        }

        .qcm-catalog-loader.is-ready .qcm-catalog-loader-badge {
            color: #166534;
            background: rgba(34, 197, 94, 0.14);
        }

        .qcm-catalog-loader-status {
            margin: 0;
            font-size: 15px;
            font-weight: 800;
            color: #1e293b;
        }

        .qcm-catalog-loader-detail {
            margin: 0;
            font-size: 13px;
            color: #64748b;
            line-height: 1.6;
        }

        .qcm-catalog-loader-track {
            width: 100%;
            height: 10px;
            border-radius: 999px;
            background: #e2e8f0;
            overflow: hidden;
        }

        .qcm-catalog-loader-bar {
            width: 0%;
            height: 100%;
            border-radius: inherit;
            background: linear-gradient(90deg, #0ea5e9 0%, #22c55e 100%);
            transition: width 0.22s ease;
        }

        .qcm-catalog-loader-foot {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            font-size: 12px;
            color: #64748b;
        }

        .qcm-catalog-loader-note {
            font-weight: 700;
            color: #0f766e;
        }

        @keyframes qcmCatalogSweep {
            from {
                transform: translateX(-100%);
            }

            to {
                transform: translateX(100%);
            }
        }

        .stats-badge {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 5px 10px;
            border-radius: 20px;
            font-size: 11px;
            font-weight: bold;
            background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
            color: #475569;
        }

        .stats-badge.correct {
            background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
            color: #047857;
        }

        .stats-badge.wrong {
            background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
            color: #dc2626;
        }

        .stats-badge.missed {
            background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
            color: #d97706;
        }

        .question-stats {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(240, 245, 250, 0.96) 100%);
            border-radius: 14px;
            padding: 8px 10px;
            margin-bottom: 10px;
            border: 1px solid #d8e3ec;
            box-shadow: 0 8px 20px rgba(148, 163, 184, 0.12);
            overflow: visible;
        }

        .stats-header {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-bottom: 0;
            font-size: 12px;
            font-weight: bold;
            color: #475569;
            white-space: nowrap;
            flex: 0 0 auto;
        }

        .stats-header:empty {
            display: none;
        }

        .stats-word-label {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            font-size: 10px;
            font-weight: 900;
            color: #1e293b;
            letter-spacing: 0.25px;
            text-transform: uppercase;
        }

        .stats-word-label i {
            font-size: 10px;
            color: #3b82f6;
        }

        .stats-details {
            font-size: 11px;
            color: #64748b;
            line-height: 1.3;
        }

        .révision-info-row {
            display: flex;
            align-items: flex-start;
            gap: 6px;
            margin-top: 4px;
        }

        .révision-info-row i {
            margin-top: 2px;
            width: 14px;
            text-align: center;
            color: #3b82f6;
            font-size: 11px;
            flex-shrink: 0;
        }

        .révision-info-key {
            min-width: 56px;
            font-size: 11px;
            font-weight: 800;
            color: #334155;
        }

        .révision-info-value {
            font-size: 11px;
            color: #64748b;
            line-height: 1.35;
            flex: 1;
        }

        .révision-date {
            display: inline-block;
            background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
            padding: 3px 8px;
            border-radius: 6px;
            margin-right: 5px;
            margin-bottom: 5px;
            font-size: 11px;
        }

        .question-stats-compact-row {
            display: flex;
            align-items: center;
            gap: 6px;
            width: 100%;
            min-width: 0;
            flex-wrap: nowrap;
        }

        .question-stats-main-frame {
            display: flex;
            align-items: center;
            gap: 6px;
            flex: 1 1 auto;
            min-width: 0;
        }

        .question-stats-pills {
            display: flex;
            align-items: center;
            gap: 5px;
            flex: 0 0 auto;
            white-space: nowrap;
        }

        .question-stats-side-pills {
            display: flex;
            align-items: center;
            gap: 5px;
            flex: 0 0 auto;
            white-space: nowrap;
        }

        .question-stats-pill {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
            min-height: 24px;
            padding: 3px 8px;
            border-radius: 999px;
            border: 1px solid transparent;
            font-size: 9px;
            font-weight: 900;
            letter-spacing: 0.15px;
            line-height: 1.1;
            white-space: nowrap;
            flex-shrink: 0;
        }

        .question-stats-pill.neutral {
            background: #f8fafc;
            border-color: #dbe7f0;
            color: #334155;
        }

        .question-stats-pill.success {
            background: #ecfdf5;
            border-color: #bbf7d0;
            color: #15803d;
        }

        .question-stats-pill.danger {
            background: #fef2f2;
            border-color: #fecaca;
            color: #dc2626;
        }

        .question-stats-pill.info {
            background: #eff6ff;
            border-color: #bfdbfe;
            color: #2563eb;
        }

        .question-stats-rating-group[hidden] {
            display: none !important;
        }

        .question-stats-days {
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 4px;
            flex: 1 1 auto;
            min-width: 0;
            overflow-x: auto;
            overflow-y: hidden;
            padding-bottom: 2px;
            white-space: nowrap;
            scrollbar-width: thin;
            scrollbar-color: rgba(148, 163, 184, 0.82) rgba(226, 232, 240, 0.74);
        }

        .question-stats-days::-webkit-scrollbar {
            height: 6px;
        }

        .question-stats-days::-webkit-scrollbar-track {
            background: rgba(226, 232, 240, 0.74);
            border-radius: 999px;
        }

        .question-stats-days::-webkit-scrollbar-thumb {
            background: rgba(148, 163, 184, 0.82);
            border-radius: 999px;
        }

        .question-day-chip {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            min-height: 22px;
            padding: 2px 7px;
            border-radius: 999px;
            border: 1px solid #d7e2ea;
            background: linear-gradient(135deg, #ffffff 0%, #f8fbfd 100%);
            color: #475569;
            font-size: 8px;
            font-weight: 800;
            line-height: 1.1;
            flex-shrink: 0;
        }

        .question-day-chip.correct-only {
            background: #f0fdf4;
            border-color: #bbf7d0;
            color: #166534;
        }

        .question-day-chip.wrong-only {
            background: #fef2f2;
            border-color: #fecaca;
            color: #b91c1c;
        }

        .question-day-chip.mixed {
            background: #fff7ed;
            border-color: #fed7aa;
            color: #c2410c;
        }

        .question-day-chip.empty {
            justify-content: center;
            min-width: max-content;
            flex: 0 0 auto;
            background: #f8fafc;
            border-style: dashed;
            color: #94a3b8;
        }

        #qcm-inline-count {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            min-width: 58px;
            padding: 3px 8px;
            border-radius: 999px;
            border: 1px solid #bfdbfe;
            background: #eff6ff;
            color: #2563eb;
            font-size: 10px;
            font-weight: 900;
            line-height: 1.2;
            vertical-align: middle;
            margin: 0 7px 2px 0;
        }

        .question-card-top-row {
            display: flex;
            justify-content: flex-end;
            align-items: flex-start;
            width: 100%;
            margin-bottom: 4px;
            transform: translateY(-3px);
        }

        .question-card-meta-actions {
            display: inline-flex;
            align-items: center;
            justify-content: flex-end;
            gap: 6px;
            flex-wrap: wrap;
            flex-shrink: 0;
        }

        #question-text {
            display: block;
            width: 100%;
            margin: 0;
            line-height: 1.24;
            word-break: break-word;
        }

        #question-text.question-text-long {
            font-size: 1rem !important;
            line-height: 1.28 !important;
        }

        #question-text.question-text-very-long {
            font-size: 0.88rem !important;
            line-height: 1.32 !important;
        }

        .question-actions-after-options {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 4px;
            flex-wrap: wrap;
            margin: 2px 0 4px;
        }

        #question-card #options-container {
            margin-top: 4px !important;
            margin-bottom: 0 !important;
        }

        .inline-next-btn,
        .inline-verify-btn,
        .inline-end-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
            min-height: 28px;
            padding: 0 10px;
            border-radius: 999px;
            border: 1.5px solid #86efac;
            background: #ffffff;
            color: #16a34a;
            font-size: 10px;
            font-weight: 900;
            line-height: 1;
            white-space: nowrap;
            box-shadow: 0 2px 8px rgba(22, 163, 74, 0.12);
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .inline-next-btn {
            border: 1.5px solid #e2e8f0;
            color: #475569;
            box-shadow: 0 2px 8px rgba(148, 163, 184, 0.12);
        }

        .inline-next-btn:hover {
            background: #f8fafc;
            border-color: #94a3b8;
        }

        .inline-verify-btn:hover {
            background: #f0fdf4;
            border-color: #4ade80;
        }

        .inline-end-btn {
            border: 1.5px solid #fecaca;
            color: #ef4444;
            box-shadow: 0 2px 8px rgba(239, 68, 68, 0.12);
        }

        .inline-end-btn:hover {
            background: #fef2f2;
            border-color: #fca5a5;
        }

        .inline-todo-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
            min-height: 28px;
            padding: 0 10px;
            border-radius: 999px;
            border: 1.5px solid #bfdbfe;
            background: #ffffff;
            color: #2563eb;
            font-size: 10px;
            font-weight: 900;
            line-height: 1;
            white-space: nowrap;
            box-shadow: 0 2px 8px rgba(37, 99, 235, 0.10);
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .inline-todo-btn:hover {
            background: #eff6ff;
            border-color: #93c5fd;
        }

        .inline-todo-btn.is-added {
            background: #eff6ff;
            color: #1d4ed8;
            border-color: #60a5fa;
        }

        .inline-verify-btn:disabled {
            opacity: 0.55;
            cursor: not-allowed;
            box-shadow: none;
        }

        .answer-inline-review {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            padding: 8px 10px;
            border-radius: 14px;
            background: rgba(255, 255, 255, 0.92);
            border: 1px solid rgba(191, 219, 254, 0.85);
            box-shadow: 0 10px 24px rgba(59, 130, 246, 0.08);
        }

        .answer-inline-track {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            min-width: 0;
        }

        .answer-inline-group {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            min-width: 0;
        }

        .answer-inline-separator {
            color: #94a3b8;
            font-family: "Sora", sans-serif;
            font-size: 22px;
            font-weight: 700;
            line-height: 1;
        }

        .answer-letter {
            font-family: "Sora", sans-serif;
            font-size: 18px;
            font-style: italic;
            font-weight: 800;
            line-height: 1;
            letter-spacing: 0.08em;
        }

        .answer-letter.correct {
            color: #166534;
        }

        .answer-letter.wrong {
            color: #ef4444;
        }

        .answer-letter.missed {
            color: #92400e;
        }

        .answer-letter.neutral {
            color: #94a3b8;
        }

        .answer-key-edit-btn,
        .answer-key-save-btn,
        .answer-key-cancel-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            min-height: 30px;
            padding: 0 12px;
            border-radius: 999px;
            font-size: 10px;
            font-weight: 900;
            line-height: 1;
            transition: all 0.2s ease;
            cursor: pointer;
        }

        .answer-key-edit-btn {
            min-width: 34px;
            width: 34px;
            padding: 0;
        }

        .answer-inline-editor {
            display: flex;
            align-items: center;
            gap: 8px;
            flex: 1 1 100%;
            flex-wrap: wrap;
        }

        .answer-key-edit-btn {
            border: 1.5px solid #bfdbfe;
            background: #eff6ff;
            color: #1d4ed8;
            box-shadow: 0 8px 18px rgba(37, 99, 235, 0.10);
        }

        .answer-key-edit-btn:hover {
            background: #dbeafe;
            border-color: #93c5fd;
        }

        .answer-key-save-btn {
            border: 1.5px solid #86efac;
            background: #f0fdf4;
            color: #15803d;
        }

        .answer-key-save-btn:hover {
            background: #dcfce7;
        }

        .answer-key-cancel-btn {
            border: 1.5px solid #e2e8f0;
            background: #ffffff;
            color: #475569;
        }

        .answer-key-cancel-btn:hover {
            background: #f8fafc;
            border-color: #cbd5e1;
        }

        .answer-key-input-row {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        .answer-key-input {
            flex: 1;
            min-width: 120px;
            min-height: 34px;
            border-radius: 14px;
            border: 1.5px solid #bfdbfe;
            background: #ffffff;
            color: #0f172a;
            font-size: 12px;
            font-weight: 800;
            padding: 0 14px;
            box-shadow: inset 0 1px 2px rgba(148, 163, 184, 0.10);
        }

        .answer-key-input:focus {
            outline: none;
            border-color: #60a5fa;
            box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.16);
        }

        #study-modal-surface {
            position: relative;
        }

        #study-modal-close {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }

        @media (min-width: 769px) {
            #study-modal-header {
                display: none !important;
            }

            #study-modal-close {
                position: absolute;
                top: 14px;
                right: 14px;
                width: 34px;
                height: 34px;
                padding: 0 !important;
                border-radius: 999px !important;
                border: 1px solid #dbe4ec !important;
                background: rgba(255, 255, 255, 0.96) !important;
                color: #475569 !important;
                box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
                z-index: 10;
            }

            #study-modal-close span {
                display: none !important;
            }
        }

        #todo-list-block {
            position: fixed;
            inset: 0;
            background: #eef5f9;
            z-index: 9999;
            display: none;
            overflow: hidden;
            flex-direction: column;
        }

        #todo-list-block.active {
            display: flex;
        }

        .todo-list-header {
            padding: 10px 14px;
            background: linear-gradient(135deg, #0f766e 0%, #155e75 100%);
            color: white;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            box-shadow: 0 10px 24px rgba(15, 118, 110, 0.22);
            flex-shrink: 0;
        }

        .todo-list-header-title {
            display: flex;
            align-items: center;
            gap: 10px;
            min-width: 0;
        }

        .todo-list-header-title i {
            font-size: 15px;
        }

        .todo-list-header-copy {
            min-width: 0;
        }

        .todo-list-header-name {
            font-size: 14px;
            font-weight: 900;
            line-height: 1.1;
        }

        .todo-list-header-subtitle {
            font-size: 10px;
            font-weight: 700;
            opacity: 0.82;
            margin-top: 2px;
        }

        .todo-list-count {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 34px;
            min-height: 26px;
            padding: 0 10px;
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.16);
            border: 1px solid rgba(255, 255, 255, 0.25);
            font-size: 11px;
            font-weight: 900;
        }

        .todo-list-close {
            width: 30px;
            height: 30px;
            border-radius: 10px;
            border: none;
            background: rgba(255, 255, 255, 0.18);
            color: white;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s ease, transform 0.2s ease;
        }

        .todo-list-close:hover {
            background: rgba(255, 255, 255, 0.28);
            transform: translateY(-1px);
        }

        .todo-list-toolbar {
            padding: 10px 12px;
            background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
            border-bottom: 1px solid #dbe5ef;
            flex-shrink: 0;
        }

        .todo-list-filters {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
        }

        .todo-filter-select {
            min-width: 138px;
            min-height: 32px;
            padding: 0 12px;
            border-radius: 999px;
            border: 1.5px solid #dbe5ef;
            background: white;
            color: #334155;
            font-size: 11px;
            font-weight: 800;
            outline: none;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 4px 10px rgba(148, 163, 184, 0.08);
        }

        .todo-filter-select:focus {
            border-color: #93c5fd;
            box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.22);
        }

        .todo-list-scroll {
            flex: 1;
            overflow-y: auto;
            padding: 12px;
        }

        .todo-list-container {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .todo-list-item {
            display: grid;
            grid-template-columns: 20px auto minmax(0, 1fr);
            gap: 10px;
            align-items: start;
            padding: 12px 14px;
            border-radius: 16px;
            border: 1px solid #dbe5ef;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
            box-shadow: 0 8px 18px rgba(148, 163, 184, 0.10);
        }

        .todo-list-item.is-done {
            background: linear-gradient(135deg, rgba(241, 245, 249, 0.98) 0%, rgba(226, 232, 240, 0.98) 100%);
        }

        .todo-list-checkbox {
            width: 16px;
            height: 16px;
            margin-top: 2px;
            accent-color: #0f766e;
            cursor: pointer;
        }

        .todo-list-text {
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .todo-list-main-line {
            display: flex;
            flex-direction: column;
            gap: 8px;
            min-width: 0;
        }

        .todo-list-title {
            font-size: 13px;
            font-weight: 900;
            color: #0f172a;
            line-height: 1.4;
            word-break: break-word;
            min-width: 0;
        }

        .todo-list-item.is-done .todo-list-title {
            color: #64748b;
            text-decoration: line-through;
        }

        .todo-list-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            min-width: 0;
        }

        .todo-list-chip {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 3px 8px;
            border-radius: 999px;
            border: 1px solid #e2e8f0;
            background: #f8fafc;
            color: #475569;
            font-size: 10px;
            font-weight: 800;
            line-height: 1;
        }

        .todo-list-test-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 26px;
            padding: 0 10px;
            border-radius: 999px;
            border: 1.5px solid #bfdbfe;
            background: #eff6ff;
            color: #1d4ed8;
            font-size: 10px;
            font-weight: 900;
            cursor: pointer;
            white-space: nowrap;
            transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
        }

        .todo-list-test-btn:hover {
            background: #dbeafe;
            border-color: #60a5fa;
            transform: translateY(-1px);
        }

        @media (min-width: 769px) {
            .todo-list-main-line {
                flex-direction: row;
                align-items: center;
                gap: 10px;
            }

            .todo-list-title {
                flex: 0 1 auto;
                max-width: min(48ch, 52%);
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }

            .todo-list-meta {
                flex: 1 1 auto;
                align-items: center;
                flex-wrap: nowrap;
                overflow-x: auto;
                overflow-y: hidden;
                white-space: nowrap;
                padding-bottom: 2px;
                scrollbar-width: thin;
            }

            .todo-list-meta::-webkit-scrollbar {
                height: 5px;
            }

            .todo-list-chip {
                flex: 0 0 auto;
            }
        }

        .todo-list-empty {
            padding: 52px 18px;
            text-align: center;
            color: #64748b;
        }

        .todo-list-empty i {
            display: block;
            font-size: 36px;
            color: #cbd5e1;
            margin-bottom: 12px;
        }

        /* Panneau de Révision */
        #révision-panel {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: white;
            z-index: 10000;
            display: none;
            flex-direction: column;
            overflow: hidden;
        }

        #révision-panel.active {
            display: flex;
        }

        .révision-header {
            padding: 20px 30px;
            background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
            color: white;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }

        .révision-header h2 {
            font-size: 24px;
            font-weight: bold;
            margin: 0;
        }

        .révision-filters {
            padding: 20px 30px;
            background: #f8fafc;
            border-bottom: 2px solid #e2e8f0;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
        }

        .révision-filter-group {
            display: flex;
            flex-direction: column;
        }

        .révision-filter-group label {
            font-size: 12px;
            font-weight: bold;
            color: #475569;
            margin-bottom: 5px;
        }

        .révision-filter-group select {
            padding: 10px;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            font-size: 14px;
            background: white;
        }

        .révision-table-container {
            flex: 1;
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 10px;
            padding: 20px;
            overflow: hidden;
        }

        .révision-column {
            display: flex;
            flex-direction: column;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .révision-column-header {
            padding: 15px;
            font-weight: bold;
            font-size: 14px;
            text-align: center;
            color: white;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .révision-column.col1 .révision-column-header {
            background: linear-gradient(135deg, #64748b 0%, #475569 100%);
        }

        .révision-column.col2 .révision-column-header {
            background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
        }

        .révision-column.col3 .révision-column-header {
            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
        }

        .révision-column.col4 .révision-column-header {
            background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
        }

        .révision-column.col5 .révision-column-header {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        }

        .révision-column-content {
            flex: 1;
            overflow-y: auto;
            padding: 10px;
            background: #f8fafc;
        }

        .révision-question-item {
            background: white;
            border-radius: 8px;
            padding: 12px;
            margin-bottom: 10px;
            cursor: pointer;
            transition: all 0.2s;
            border: 2px solid transparent;
        }

        .révision-question-item:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        .révision-question-item.selected {
            border-color: #4f46e5;
            background: #eef2ff;
        }

        .révision-question-item input[type="checkbox"] {
            margin-right: 8px;
        }

        .révision-question-meta {
            font-size: 11px;
            color: #64748b;
            margin-top: 8px;
            display: flex;
            flex-wrap: wrap;
            gap: 5px;
        }

        .révision-question-meta span {
            background: #e2e8f0;
            padding: 2px 6px;
            border-radius: 4px;
        }

        .révision-question-text {
            font-size: 13px;
            font-weight: 600;
            color: #1e293b;
            margin-bottom: 5px;
        }

        .révision-question-count {
            font-size: 10px;
            color: #94a3b8;
            font-style: italic;
            margin-top: 5px;
        }

        .révision-select-all-btn {
            background: rgba(255, 255, 255, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.3);
            color: white;
            padding: 5px 10px;
            border-radius: 6px;
            font-size: 11px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .révision-select-all-btn:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        .révision-actions {
            padding: 20px 30px;
            background: #f8fafc;
            border-top: 2px solid #e2e8f0;
            display: flex;
            justify-content: center;
            gap: 15px;
        }

        .révision-test-btn {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            color: white;
            padding: 12px 30px;
            border-radius: 10px;
            font-weight: bold;
            font-size: 16px;
            border: none;
            cursor: pointer;
            transition: all 0.3s;
            box-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
        }

        .révision-test-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 12px rgba(16, 185, 129, 0.4);
        }

        .révision-test-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none;
        }

        /* Modern Multi-Select Filters for Revision Panel */
        .révision-filter-container {
            position: relative;
            display: inline-block;
        }

        .révision-filter-btn {
            background: white;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 6px 12px;
            font-size: 11px;
            font-weight: 600;
            color: #475569;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
            transition: all 0.2s;
            min-width: 100px;
        }

        .révision-filter-btn:hover {
            background: #f8fafc;
            border-color: #cbd5e1;
        }

        .révision-filter-btn.active {
            border-color: #3b82f6;
            background: #eff6ff;
            color: #2563eb;
        }

        .révision-filter-btn i {
            font-size: 9px;
            margin-left: auto;
            transition: transform 0.2s;
        }

        .révision-filter-btn.open i {
            transform: rotate(180deg);
        }

        .révision-filter-dropdown {
            position: absolute;
            top: calc(100% + 4px);
            left: 0;
            background: white;
            border: 1px solid #e2e8f0;
            border-radius: 10px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            min-width: 200px;
            max-height: 300px;
            overflow-y: auto;
            z-index: 1000;
            display: none;
            padding: 8px;
        }

        .révision-filter-dropdown.show {
            display: block;
        }

        .révision-filter-option {
            display: flex;
            align-items: center;
            padding: 8px 10px;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s;
            gap: 8px;
        }

        .révision-filter-option:hover {
            background: #f1f5f9;
        }

        .révision-filter-option input[type="checkbox"] {
            width: 16px;
            height: 16px;
            cursor: pointer;
            accent-color: #3b82f6;
            border-radius: 4px;
        }

        .révision-filter-option label {
            flex: 1;
            cursor: pointer;
            font-size: 12px;
            font-weight: 500;
            color: #000000;
        }

        .révision-filter-option span {
            flex: 1;
            cursor: pointer;
            font-size: 12px;
            font-weight: 500;
            color: #000000;
        }

        .révision-filter-option input[type="checkbox"]:checked+label,
        .révision-filter-option input[type="checkbox"]:checked+span {
            color: #2563eb;
            font-weight: 600;
        }

        .révision-filter-header {
            padding: 8px 10px;
            border-bottom: 1px solid #e2e8f0;
            margin-bottom: 6px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .révision-filter-title {
            font-size: 11px;
            font-weight: 700;
            color: #64748b;
            text-transform: uppercase;
        }

        .révision-filter-clear {
            font-size: 10px;
            color: #ef4444;
            cursor: pointer;
            padding: 2px 6px;
            border-radius: 4px;
            transition: all 0.2s;
        }

        .révision-filter-clear:hover {
            background: #fee2e2;
        }

        .révision-test-btn-small {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            color: white;
            padding: 6px 16px;
            border-radius: 8px;
            font-weight: bold;
            font-size: 11px;
            border: none;
            cursor: pointer;
            transition: all 0.3s;
            box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
        }

        .révision-test-btn-small:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
        }

        .révision-test-btn-small:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none;
        }

        .question-number {
            position: absolute;
            top: -12px;
            left: 20px;
            background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
            color: white;
            width: 35px;
            height: 35px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 15px;
            box-shadow: 0 6px 15px rgba(59, 130, 246, 0.3);
            z-index: 10;
        }

        .question-card-head {
            position: relative;
            z-index: 2;
        }

        .question-card-body {
            position: relative;
            z-index: 1;
        }

        .question-number {
            display: none !important;
        }

        .filter-selection-panel {
            display: none;
            position: absolute;
            top: calc(100% + 6px);
            left: 0;
            background: white;
            border: 2px solid #e2e8f0;
            border-radius: 9px;
            padding: 6px;
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
            z-index: 4000;
            width: auto;
            min-width: 0;
            max-width: calc(100vw - 24px);
            max-height: 220px;
            overflow-y: auto;
            font-size: 9px;
            box-sizing: border-box;
        }

        .filter-badge.active .filter-selection-panel {
            display: block;
        }

        .filter-option-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 6px;
            padding: 5px 8px;
            margin-bottom: 4px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 9px;
            line-height: 1.1;
            transition: all 0.2s;
        }

        .filter-option-item span:first-child {
            flex: 1 1 auto;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            word-break: normal;
        }

        .filter-option-item span:last-child {
            flex: 0 0 auto;
            white-space: nowrap;
            font-size: 8px;
        }

        .filter-option-item:hover {
            background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
        }

        .filter-option-item.selected {
            background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
            color: white;
        }

        .filter-empty-state {
            padding: 8px 10px;
            text-align: center;
            color: #94a3b8;
            font-size: 10px;
            font-weight: 700;
        }

        .image-preview {
            max-width: 100%;
            max-height: 250px;
            border-radius: 12px;
            margin-top: 12px;
            border: 2px solid #e2e8f0;
            cursor: pointer;
        }

        /* Image modal styles */

        .form-group {
            margin-bottom: 15px;
        }

        .form-label {
            display: block;
            font-size: 13px;
            font-weight: bold;
            color: #475569;
            margin-bottom: 6px;
        }

        .form-input {
            width: 100%;
            padding: 10px 15px;
            border: 2px solid #e2e8f0;
            border-radius: 12px;
            font-size: 13px;
            transition: all 0.3s;
        }

        .form-input:focus {
            border-color: #8b5cf6;
            outline: none;
            box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
        }

        .form-textarea {
            width: 100%;
            padding: 10px 15px;
            border: 2px solid #e2e8f0;
            border-radius: 12px;
            font-size: 13px;
            min-height: 100px;
            resize: vertical;
            transition: all 0.3s;
        }

        .form-textarea:focus {
            border-color: #8b5cf6;
            outline: none;
            box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
        }

        .form-buttons {
            display: flex;
            gap: 12px;
            justify-content: flex-end;
            margin-top: 20px;
        }

        .btn {
            padding: 8px 15px;
            border-radius: 10px;
            font-size: 13px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s;
            border: none;
        }

        .btn-primary {
            background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
            color: white;
        }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 15px rgba(139, 92, 246, 0.3);
        }

        .btn-secondary {
            background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
            color: #475569;
            border: 2px solid #cbd5e1;
        }

        .btn-secondary:hover {
            background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
        }

        .history-item {
            background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
            padding: 12px;
            border-radius: 12px;
            margin-bottom: 12px;
            border-left: 6px solid #3b82f6;
            cursor: pointer;
            transition: all 0.3s;
            position: relative;
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
        }

        .history-item:hover {
            background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
            transform: translateY(-2px);
            box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
        }

        .history-item.collapsed {
            padding: 10px 12px;
        }

        .history-item.collapsed .history-details {
            display: none;
        }

        .history-item.collapsed .history-stats {
            display: none;
        }

        .history-item.collapsed .history-modules {
            display: none;
        }

        .history-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
        }

        .history-title {
            font-size: 12px;
            font-weight: bold;
            color: #60a5fa;
        }

        .history-date {
            font-size: 10px;
            color: #94a3b8;
        }

        .history-collapse-btn {
            background: none;
            border: none;
            color: #94a3b8;
            cursor: pointer;
            font-size: 10px;
            padding: 2px 6px;
            border-radius: 5px;
        }

        .history-collapse-btn:hover {
            color: white;
            background: #475569;
        }

        .history-stats {
            display: flex;
            justify-content: space-between;
            margin-bottom: 8px;
            font-size: 10px;
        }

        .history-details {
            font-size: 9px;
            color: #cbd5e1;
            line-height: 1.4;
        }

        .history-modules {
            margin-top: 8px;
            padding-top: 8px;
            border-top: 2px solid #374151;
        }

        .history-module-item {
            display: inline-block;
            background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
            padding: 2px 6px;
            border-radius: 5px;
            margin-right: 4px;
            margin-bottom: 4px;
            font-size: 9px;
            color: #cbd5e1;
        }

        /* Timer styles */
        .question-timers {
            display: flex;
            gap: 15px;
            margin: 15px 0;
            justify-content: center;
        }

        .timer-box {
            background: white;
            border-radius: 8px;
            padding: 8px 12px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            min-width: 90px;
            border-left: 4px solid #3b82f6;
        }

        .timer-label {
            font-size: 9px;
            font-weight: bold;
            color: #64748b;
            text-transform: uppercase;
            margin-bottom: 2px;
        }

        .timer-value {
            font-size: 16px;
            font-weight: 900;
            color: #1e293b;
        }

        .timer-qcm {
            border-left: 4px solid #3b82f6;
        }

        .timer-total {
            border-left: 4px solid #10b981;
        }

        .max-limit-hint {
            font-size: 12px;
            color: #ef4444;
            font-weight: bold;
            margin-top: 6px;
            display: none;
        }

        .auto-explanation {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: min(760px, calc(100vw - 32px));
            max-height: min(78vh, 720px);
            overflow-y: auto;
            margin-top: 0;
            padding: 15px;
            background: #ffffff;
            border-radius: 14px;
            border: 1px solid #dbe3ef;
            font-size: 14px;
            line-height: 1.5;
            color: #475569;
            box-shadow: 0 24px 60px rgba(2, 6, 23, 0.25);
            z-index: 13001;
        }

        .explanation-header {
            font-weight: bold;
            color: #3b82f6;
            margin-bottom: 10px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        #auto-explanation-backdrop {
            position: fixed;
            inset: 0;
            background: rgba(15, 23, 42, 0.48);
            backdrop-filter: blur(2px);
            z-index: 13000;
            display: none;
        }

        ::-webkit-scrollbar {
            width: 6px;
        }

        ::-webkit-scrollbar-track {
            background: #ffffff;
            border-radius: 4px;
        }

        ::-webkit-scrollbar-thumb {
            background: #e2e8f0;
            border-radius: 4px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: #cbd5e1;
        }

        body:not(.dark-theme),
        body:not(.dark-theme) * {
            scrollbar-color: rgba(226, 232, 240, 0.98) rgba(255, 255, 255, 0.98);
        }

        body:not(.dark-theme)::-webkit-scrollbar-track,
        body:not(.dark-theme) *::-webkit-scrollbar-track {
            background: #ffffff;
        }

        body:not(.dark-theme)::-webkit-scrollbar-thumb,
        body:not(.dark-theme) *::-webkit-scrollbar-thumb {
            background: linear-gradient(180deg, rgba(226, 232, 240, 0.98) 0%, rgba(203, 213, 225, 0.98) 100%);
            border-radius: 999px;
        }

        body:not(.dark-theme)::-webkit-scrollbar-thumb:hover,
        body:not(.dark-theme) *::-webkit-scrollbar-thumb:hover {
            background: linear-gradient(180deg, rgba(203, 213, 225, 1) 0%, rgba(148, 163, 184, 1) 100%);
        }

        body.dark-theme,
        body.dark-theme * {
            scrollbar-color: rgba(148, 163, 184, 0.92) rgba(15, 23, 42, 0.38);
        }

        body.dark-theme::-webkit-scrollbar,
        body.dark-theme *::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }

        body.dark-theme::-webkit-scrollbar-track,
        body.dark-theme *::-webkit-scrollbar-track {
            background: rgba(30, 41, 59, 0.36);
            border-radius: 999px;
        }

        body.dark-theme::-webkit-scrollbar-thumb,
        body.dark-theme *::-webkit-scrollbar-thumb {
            background: linear-gradient(180deg, rgba(148, 163, 184, 0.95) 0%, rgba(100, 116, 139, 0.95) 100%);
            border-radius: 999px;
        }

        body.dark-theme::-webkit-scrollbar-thumb:hover,
        body.dark-theme *::-webkit-scrollbar-thumb:hover {
            background: linear-gradient(180deg, rgba(203, 213, 225, 0.95) 0%, rgba(148, 163, 184, 0.95) 100%);
        }

        #srs-block .srs-filters-grid {
            display: grid !important;
            grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
            align-items: stretch !important;
            gap: 6px !important;
            flex-wrap: initial !important;
            overflow: visible !important;
            scrollbar-width: thin;
        }

        #srs-block .srs-filter-select {
            width: 100% !important;
            height: 32px !important;
            min-width: 0 !important;
            padding: 0 10px !important;
            border-radius: 12px !important;
            border: 1.5px solid #cbd5e1 !important;
            background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
            color: #1e293b !important;
            font-size: 10px !important;
            font-weight: 800 !important;
            outline: none !important;
            cursor: pointer !important;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 4px 10px rgba(148, 163, 184, 0.08);
            flex: initial;
        }

        #srs-block .srs-filter-select:focus {
            border-color: #0d9488 !important;
            box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.14) !important;
        }

        /* Unified ultra-compact filter pills */
        .simulation-inline-controls-grid,
        .simulation-module-controls-grid,
        .simulation-table-filters,
        .todo-list-filters,
        #srs-block .srs-filters-grid {
            gap: 4px !important;
        }

        .simulation-inline-column {
            gap: 4px !important;
        }

        .simulation-inline-controls-grid .simulation-field,
        .simulation-module-controls-grid .simulation-field,
        .simulation-table-filters > *,
        .todo-list-filters > *,
        #srs-block .srs-filters-grid > * {
            --filter-pill-bg: linear-gradient(180deg, #ebf5ff 0%, #dbeafe 100%);
            --filter-pill-border: #bfdbfe;
            --filter-pill-text: #1d4ed8;
            --filter-pill-arrow: rgba(29, 78, 216, 0.84);
            --filter-pill-focus: #93c5fd;
            --filter-pill-focus-ring: rgba(59, 130, 246, 0.18);
            --filter-panel-bg: linear-gradient(180deg, #ffffff 0%, #eef5ff 100%);
            --filter-panel-shadow: 0 12px 26px rgba(148, 163, 184, 0.12);
            --filter-option-bg: rgba(219, 234, 254, 0.74);
            --filter-option-hover-bg: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
            --filter-option-active-bg: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
            --filter-option-active-text: #ffffff;
        }

        .simulation-inline-controls-grid .simulation-field:nth-child(8n + 1),
        .simulation-module-controls-grid .simulation-field:nth-child(8n + 1),
        .simulation-table-filters > :nth-child(8n + 1),
        .todo-list-filters > :nth-child(8n + 1),
        #srs-block .srs-filters-grid > :nth-child(8n + 1) {
            --filter-pill-bg: linear-gradient(180deg, #edf6ff 0%, #dcecff 100%);
            --filter-pill-border: #bfd8ff;
            --filter-pill-text: #1d4ed8;
            --filter-pill-arrow: rgba(29, 78, 216, 0.84);
            --filter-pill-focus: #93c5fd;
            --filter-pill-focus-ring: rgba(59, 130, 246, 0.18);
            --filter-panel-bg: linear-gradient(180deg, #ffffff 0%, #edf6ff 100%);
            --filter-option-bg: rgba(219, 234, 254, 0.76);
            --filter-option-hover-bg: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
            --filter-option-active-bg: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
        }

        .simulation-inline-controls-grid .simulation-field:nth-child(8n + 2),
        .simulation-module-controls-grid .simulation-field:nth-child(8n + 2),
        .simulation-table-filters > :nth-child(8n + 2),
        .todo-list-filters > :nth-child(8n + 2),
        #srs-block .srs-filters-grid > :nth-child(8n + 2) {
            --filter-pill-bg: linear-gradient(180deg, #f6efff 0%, #eadcff 100%);
            --filter-pill-border: #dcc6ff;
            --filter-pill-text: #7c3aed;
            --filter-pill-arrow: rgba(124, 58, 237, 0.82);
            --filter-pill-focus: #c4b5fd;
            --filter-pill-focus-ring: rgba(168, 85, 247, 0.18);
            --filter-panel-bg: linear-gradient(180deg, #ffffff 0%, #f5efff 100%);
            --filter-option-bg: rgba(233, 213, 255, 0.74);
            --filter-option-hover-bg: linear-gradient(180deg, #eadcff 0%, #d8b4fe 100%);
            --filter-option-active-bg: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
        }

        .simulation-inline-controls-grid .simulation-field:nth-child(8n + 3),
        .simulation-module-controls-grid .simulation-field:nth-child(8n + 3),
        .simulation-table-filters > :nth-child(8n + 3),
        .todo-list-filters > :nth-child(8n + 3),
        #srs-block .srs-filters-grid > :nth-child(8n + 3) {
            --filter-pill-bg: linear-gradient(180deg, #ebfffb 0%, #d7faf3 100%);
            --filter-pill-border: #a7f3d0;
            --filter-pill-text: #0f766e;
            --filter-pill-arrow: rgba(15, 118, 110, 0.82);
            --filter-pill-focus: #5eead4;
            --filter-pill-focus-ring: rgba(20, 184, 166, 0.18);
            --filter-panel-bg: linear-gradient(180deg, #ffffff 0%, #ecfdf8 100%);
            --filter-option-bg: rgba(204, 251, 241, 0.76);
            --filter-option-hover-bg: linear-gradient(180deg, #ccfbf1 0%, #99f6e4 100%);
            --filter-option-active-bg: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%);
        }

        .simulation-inline-controls-grid .simulation-field:nth-child(8n + 4),
        .simulation-module-controls-grid .simulation-field:nth-child(8n + 4),
        .simulation-table-filters > :nth-child(8n + 4),
        .todo-list-filters > :nth-child(8n + 4),
        #srs-block .srs-filters-grid > :nth-child(8n + 4) {
            --filter-pill-bg: linear-gradient(180deg, #fff7e8 0%, #ffe8bf 100%);
            --filter-pill-border: #fcd34d;
            --filter-pill-text: #b45309;
            --filter-pill-arrow: rgba(180, 83, 9, 0.82);
            --filter-pill-focus: #fbbf24;
            --filter-pill-focus-ring: rgba(245, 158, 11, 0.18);
            --filter-panel-bg: linear-gradient(180deg, #ffffff 0%, #fff8eb 100%);
            --filter-option-bg: rgba(254, 243, 199, 0.78);
            --filter-option-hover-bg: linear-gradient(180deg, #fde68a 0%, #fcd34d 100%);
            --filter-option-active-bg: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
        }

        .simulation-inline-controls-grid .simulation-field:nth-child(8n + 5),
        .simulation-module-controls-grid .simulation-field:nth-child(8n + 5),
        .simulation-table-filters > :nth-child(8n + 5),
        .todo-list-filters > :nth-child(8n + 5),
        #srs-block .srs-filters-grid > :nth-child(8n + 5) {
            --filter-pill-bg: linear-gradient(180deg, #fff1f6 0%, #ffd9e7 100%);
            --filter-pill-border: #f9a8d4;
            --filter-pill-text: #be185d;
            --filter-pill-arrow: rgba(190, 24, 93, 0.82);
            --filter-pill-focus: #f472b6;
            --filter-pill-focus-ring: rgba(236, 72, 153, 0.18);
            --filter-panel-bg: linear-gradient(180deg, #ffffff 0%, #fff1f6 100%);
            --filter-option-bg: rgba(252, 231, 243, 0.8);
            --filter-option-hover-bg: linear-gradient(180deg, #fbcfe8 0%, #f9a8d4 100%);
            --filter-option-active-bg: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
        }

        .simulation-inline-controls-grid .simulation-field:nth-child(8n + 6),
        .simulation-module-controls-grid .simulation-field:nth-child(8n + 6),
        .simulation-table-filters > :nth-child(8n + 6),
        .todo-list-filters > :nth-child(8n + 6),
        #srs-block .srs-filters-grid > :nth-child(8n + 6) {
            --filter-pill-bg: linear-gradient(180deg, #eefcff 0%, #d6f4ff 100%);
            --filter-pill-border: #7dd3fc;
            --filter-pill-text: #0369a1;
            --filter-pill-arrow: rgba(3, 105, 161, 0.82);
            --filter-pill-focus: #38bdf8;
            --filter-pill-focus-ring: rgba(14, 165, 233, 0.18);
            --filter-panel-bg: linear-gradient(180deg, #ffffff 0%, #eefcff 100%);
            --filter-option-bg: rgba(224, 242, 254, 0.78);
            --filter-option-hover-bg: linear-gradient(180deg, #bae6fd 0%, #7dd3fc 100%);
            --filter-option-active-bg: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
        }

        .simulation-inline-controls-grid .simulation-field:nth-child(8n + 7),
        .simulation-module-controls-grid .simulation-field:nth-child(8n + 7),
        .simulation-table-filters > :nth-child(8n + 7),
        .todo-list-filters > :nth-child(8n + 7),
        #srs-block .srs-filters-grid > :nth-child(8n + 7) {
            --filter-pill-bg: linear-gradient(180deg, #eef2ff 0%, #dfe5ff 100%);
            --filter-pill-border: #c7d2fe;
            --filter-pill-text: #4338ca;
            --filter-pill-arrow: rgba(67, 56, 202, 0.82);
            --filter-pill-focus: #a5b4fc;
            --filter-pill-focus-ring: rgba(99, 102, 241, 0.18);
            --filter-panel-bg: linear-gradient(180deg, #ffffff 0%, #eef2ff 100%);
            --filter-option-bg: rgba(224, 231, 255, 0.78);
            --filter-option-hover-bg: linear-gradient(180deg, #c7d2fe 0%, #a5b4fc 100%);
            --filter-option-active-bg: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
        }

        .simulation-inline-controls-grid .simulation-field:nth-child(8n + 8),
        .simulation-module-controls-grid .simulation-field:nth-child(8n + 8),
        .simulation-table-filters > :nth-child(8n + 8),
        .todo-list-filters > :nth-child(8n + 8),
        #srs-block .srs-filters-grid > :nth-child(8n + 8) {
            --filter-pill-bg: linear-gradient(180deg, #effdf4 0%, #d8f7e6 100%);
            --filter-pill-border: #86efac;
            --filter-pill-text: #15803d;
            --filter-pill-arrow: rgba(21, 128, 61, 0.82);
            --filter-pill-focus: #4ade80;
            --filter-pill-focus-ring: rgba(34, 197, 94, 0.18);
            --filter-panel-bg: linear-gradient(180deg, #ffffff 0%, #effdf4 100%);
            --filter-option-bg: rgba(220, 252, 231, 0.78);
            --filter-option-hover-bg: linear-gradient(180deg, #bbf7d0 0%, #86efac 100%);
            --filter-option-active-bg: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
        }

        #simulation-builder-panel .simulation-inline-controls-grid .simulation-field[class*="simulation-filter-theme-"] {
            --filter-pill-bg: #ffffff;
            --filter-pill-border: transparent;
            --filter-pill-text: #334155;
            --filter-pill-arrow: rgba(100, 116, 139, 0.82);
            --filter-pill-focus: #e2e8f0;
            --filter-pill-focus-ring: rgba(148, 163, 184, 0.12);
            --filter-panel-bg: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
            --filter-panel-shadow: 0 12px 26px rgba(148, 163, 184, 0.12);
            --filter-option-bg: rgba(248, 250, 252, 0.98);
            --filter-option-hover-bg: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
            --filter-option-active-bg: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
            --filter-option-active-text: #0f172a;
            --simulation-filter-accent: #334155;
            --simulation-filter-btn-bg: #ffffff;
            --simulation-filter-panel-bg: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
            --simulation-filter-option-bg: rgba(248, 250, 252, 0.98);
            --simulation-filter-option-hover-bg: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
            --simulation-filter-option-active-bg: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
            --simulation-filter-border: transparent;
            --simulation-filter-shadow: rgba(148, 163, 184, 0.12);
        }

        #simulation-builder-panel .simulation-inline-controls-grid .simulation-field[class*="simulation-filter-theme-"] .simulation-module-btn-icon {
            color: #64748b !important;
        }

        #simulation-builder-panel .simulation-inline-controls-grid .simulation-field.simulation-filter-theme-year {
            --builder-filter-pill-bg: linear-gradient(180deg, #fff4f4 0%, #ffe1e1 100%);
            --builder-filter-border: #f6b8b8;
            --builder-filter-text: #b91c1c;
            --builder-filter-arrow: rgba(185, 28, 28, 0.82);
            --builder-filter-focus: #fca5a5;
            --builder-filter-focus-ring: rgba(248, 113, 113, 0.18);
            --builder-filter-panel-bg: linear-gradient(180deg, #ffffff 0%, #fff1f2 100%);
            --builder-filter-option-bg: rgba(254, 226, 226, 0.8);
            --builder-filter-option-hover-bg: linear-gradient(180deg, #fecaca 0%, #fda4af 100%);
            --builder-filter-option-active-bg: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
            --builder-filter-shadow: rgba(239, 68, 68, 0.16);
        }

        #simulation-builder-panel .simulation-inline-controls-grid .simulation-field.simulation-filter-theme-rotation {
            --builder-filter-pill-bg: linear-gradient(180deg, #fffcec 0%, #fff4c7 100%);
            --builder-filter-border: #f5db7b;
            --builder-filter-text: #a16207;
            --builder-filter-arrow: rgba(161, 98, 7, 0.82);
            --builder-filter-focus: #facc15;
            --builder-filter-focus-ring: rgba(234, 179, 8, 0.18);
            --builder-filter-panel-bg: linear-gradient(180deg, #ffffff 0%, #fffbea 100%);
            --builder-filter-option-bg: rgba(254, 249, 195, 0.82);
            --builder-filter-option-hover-bg: linear-gradient(180deg, #fef08a 0%, #fde047 100%);
            --builder-filter-option-active-bg: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
            --builder-filter-shadow: rgba(234, 179, 8, 0.16);
        }

        #simulation-builder-panel .simulation-inline-controls-grid .simulation-field.simulation-filter-theme-order {
            --builder-filter-pill-bg: linear-gradient(180deg, #f1fcf3 0%, #ddf7e3 100%);
            --builder-filter-border: #9dd8ac;
            --builder-filter-text: #15803d;
            --builder-filter-arrow: rgba(21, 128, 61, 0.82);
            --builder-filter-focus: #86efac;
            --builder-filter-focus-ring: rgba(34, 197, 94, 0.18);
            --builder-filter-panel-bg: linear-gradient(180deg, #ffffff 0%, #eefcf1 100%);
            --builder-filter-option-bg: rgba(220, 252, 231, 0.8);
            --builder-filter-option-hover-bg: linear-gradient(180deg, #bbf7d0 0%, #86efac 100%);
            --builder-filter-option-active-bg: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
            --builder-filter-shadow: rgba(34, 197, 94, 0.16);
        }

        #simulation-builder-panel .simulation-inline-controls-grid .simulation-field.simulation-filter-theme-languages {
            --builder-filter-pill-bg: linear-gradient(180deg, #eff7ff 0%, #dcebff 100%);
            --builder-filter-border: #bdd4ff;
            --builder-filter-text: #1d4ed8;
            --builder-filter-arrow: rgba(29, 78, 216, 0.84);
            --builder-filter-focus: #93c5fd;
            --builder-filter-focus-ring: rgba(59, 130, 246, 0.18);
            --builder-filter-panel-bg: linear-gradient(180deg, #ffffff 0%, #eef5ff 100%);
            --builder-filter-option-bg: rgba(219, 234, 254, 0.8);
            --builder-filter-option-hover-bg: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
            --builder-filter-option-active-bg: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
            --builder-filter-shadow: rgba(59, 130, 246, 0.16);
        }

        #simulation-builder-panel .simulation-inline-controls-grid .simulation-field.simulation-filter-theme-exam-year {
            --builder-filter-pill-bg: linear-gradient(180deg, #fff3f8 0%, #ffddea 100%);
            --builder-filter-border: #f7bfd5;
            --builder-filter-text: #be185d;
            --builder-filter-arrow: rgba(190, 24, 93, 0.82);
            --builder-filter-focus: #f9a8d4;
            --builder-filter-focus-ring: rgba(236, 72, 153, 0.18);
            --builder-filter-panel-bg: linear-gradient(180deg, #ffffff 0%, #fff1f6 100%);
            --builder-filter-option-bg: rgba(252, 231, 243, 0.82);
            --builder-filter-option-hover-bg: linear-gradient(180deg, #fbcfe8 0%, #f9a8d4 100%);
            --builder-filter-option-active-bg: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
            --builder-filter-shadow: rgba(236, 72, 153, 0.16);
        }

        #simulation-builder-panel .simulation-inline-controls-grid .simulation-field.simulation-filter-theme-shuffle-options {
            --builder-filter-pill-bg: linear-gradient(180deg, #f7f1ff 0%, #eadfff 100%);
            --builder-filter-border: #d9c5ff;
            --builder-filter-text: #7c3aed;
            --builder-filter-arrow: rgba(124, 58, 237, 0.82);
            --builder-filter-focus: #c4b5fd;
            --builder-filter-focus-ring: rgba(168, 85, 247, 0.18);
            --builder-filter-panel-bg: linear-gradient(180deg, #ffffff 0%, #f6f0ff 100%);
            --builder-filter-option-bg: rgba(237, 233, 254, 0.82);
            --builder-filter-option-hover-bg: linear-gradient(180deg, #ddd6fe 0%, #c4b5fd 100%);
            --builder-filter-option-active-bg: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
            --builder-filter-shadow: rgba(139, 92, 246, 0.16);
        }

        #simulation-builder-panel .simulation-inline-controls-grid .simulation-field.simulation-filter-theme-faculty {
            --builder-filter-pill-bg: linear-gradient(180deg, #fff6eb 0%, #ffe4c8 100%);
            --builder-filter-border: #f6c58f;
            --builder-filter-text: #c2410c;
            --builder-filter-arrow: rgba(194, 65, 12, 0.82);
            --builder-filter-focus: #fdba74;
            --builder-filter-focus-ring: rgba(249, 115, 22, 0.18);
            --builder-filter-panel-bg: linear-gradient(180deg, #ffffff 0%, #fff7ed 100%);
            --builder-filter-option-bg: rgba(255, 237, 213, 0.82);
            --builder-filter-option-hover-bg: linear-gradient(180deg, #fed7aa 0%, #fdba74 100%);
            --builder-filter-option-active-bg: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
            --builder-filter-shadow: rgba(249, 115, 22, 0.16);
        }

        #simulation-builder-panel .simulation-inline-controls-grid .simulation-field.simulation-filter-theme-distribution {
            --builder-filter-pill-bg: linear-gradient(180deg, #fff4f4 0%, #ffe1e1 100%);
            --builder-filter-border: #f6b8b8;
            --builder-filter-text: #b91c1c;
            --builder-filter-arrow: rgba(185, 28, 28, 0.82);
            --builder-filter-focus: #fca5a5;
            --builder-filter-focus-ring: rgba(248, 113, 113, 0.18);
            --builder-filter-panel-bg: linear-gradient(180deg, #ffffff 0%, #fff1f2 100%);
            --builder-filter-option-bg: rgba(254, 226, 226, 0.8);
            --builder-filter-option-hover-bg: linear-gradient(180deg, #fecaca 0%, #fda4af 100%);
            --builder-filter-option-active-bg: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
            --builder-filter-shadow: rgba(239, 68, 68, 0.16);
        }

        .simulation-inline-controls-grid .simulation-field,
        .simulation-module-controls-grid .simulation-field,
        .simulation-title-actions-row .simulation-field {
            gap: 3px !important;
        }

        .simulation-inline-controls-grid .simulation-field-label,
        .simulation-module-controls-grid .simulation-field-label,
        .simulation-title-actions-row .simulation-field-label {
            min-height: auto !important;
            margin-bottom: 1px;
            font-size: 0.78rem !important;
            font-weight: 800 !important;
            letter-spacing: 0.01em;
            color: #0f172a !important;
        }

        .simulation-inline-controls-grid .simulation-field-select,
        .simulation-inline-controls-grid .simulation-field-input,
        .simulation-module-controls-grid .simulation-field-select,
        .simulation-module-controls-grid .simulation-field-input,
        .simulation-table-filters .simulation-field-select,
        .simulation-title-count-field .simulation-field-input,
        .simulation-inline-controls-grid .simulation-toggle-item,
        .simulation-compact-picker .simulation-module-btn,
        .todo-filter-select,
        #srs-block .srs-filter-select {
            min-height: 30px !important;
            height: 30px !important;
            padding: 0 10px !important;
            border-radius: 999px !important;
            border: 1px solid transparent !important;
            background: #ffffff !important;
            color: #334155 !important;
            font-size: 14px !important;
            font-weight: 800 !important;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.98), 0 3px 8px rgba(148, 163, 184, 0.05) !important;
        }

        .simulation-inline-controls-grid .simulation-field-select,
        .simulation-module-controls-grid .simulation-field-select,
        .simulation-table-filters .simulation-field-select,
        .todo-filter-select,
        #srs-block select.srs-filter-select {
            appearance: none !important;
            -webkit-appearance: none !important;
            padding-right: 28px !important;
            background-image:
                linear-gradient(45deg, transparent 50%, rgba(100, 116, 139, 0.82) 50%),
                linear-gradient(135deg, rgba(100, 116, 139, 0.82) 50%, transparent 50%),
                linear-gradient(180deg, #ffffff 0%, #ffffff 100%) !important;
            background-position:
                calc(100% - 14px) calc(50% - 2px),
                calc(100% - 10px) calc(50% - 2px),
                0 0 !important;
            background-size: 6px 6px, 6px 6px, 100% 100% !important;
            background-repeat: no-repeat !important;
        }

        #simulation-builder-panel .simulation-field.simulation-filter-theme-distribution {
            --filter-pill-bg: #ffffff !important;
            --filter-pill-border: transparent !important;
            --filter-pill-text: #334155 !important;
            --filter-pill-arrow: rgba(100, 116, 139, 0.82) !important;
            --filter-pill-focus: #e2e8f0 !important;
            --filter-pill-focus-ring: rgba(148, 163, 184, 0.12) !important;
        }

        #simulation-builder-panel .simulation-field.simulation-filter-theme-distribution .simulation-field-select,
        #simulation-builder-panel #dist-mode {
            border-color: transparent !important;
            background:
                linear-gradient(45deg, transparent 50%, rgba(100, 116, 139, 0.82) 50%),
                linear-gradient(135deg, rgba(100, 116, 139, 0.82) 50%, transparent 50%),
                linear-gradient(180deg, #ffffff 0%, #ffffff 100%) !important;
            color: #334155 !important;
        }

        .simulation-inline-controls-grid .simulation-field-select option,
        .simulation-module-controls-grid .simulation-field-select option,
        .simulation-table-filters .simulation-field-select option,
        .todo-filter-select option,
        #srs-block .srs-filter-select option {
            font-size: 14px !important;
            font-weight: 700 !important;
        }

        .simulation-inline-controls-grid .simulation-field-select:focus,
        .simulation-inline-controls-grid .simulation-field-input:focus,
        .simulation-module-controls-grid .simulation-field-select:focus,
        .simulation-module-controls-grid .simulation-field-input:focus,
        .simulation-table-filters .simulation-field-select:focus,
        .simulation-title-count-field .simulation-field-input:focus,
        .todo-filter-select:focus,
        #srs-block .srs-filter-select:focus,
        .simulation-compact-picker .simulation-module-btn:focus {
            border-color: transparent !important;
            box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12) !important;
        }

        .simulation-inline-controls-grid .simulation-toggle-item {
            justify-content: space-between !important;
            gap: 8px !important;
        }

        .simulation-inline-controls-grid .simulation-toggle-item span {
            font-size: 12px !important;
            font-weight: 900 !important;
            color: var(--filter-pill-text, #24406e) !important;
        }

        .simulation-compact-picker .simulation-module-btn {
            padding-inline: 10px !important;
        }

        .simulation-compact-picker .simulation-module-panel {
            top: calc(100% + 4px);
            padding: 5px;
            border-radius: 16px;
            border-color: var(--filter-pill-border, #c8d8ee);
            background: var(--filter-panel-bg, linear-gradient(180deg, #fbfdff 0%, #eef4ff 100%));
            box-shadow: var(--filter-panel-shadow, 0 12px 26px rgba(148, 163, 184, 0.12));
        }

        .simulation-compact-picker .simulation-module-list {
            gap: 3px;
            max-height: 220px;
        }

        .simulation-compact-picker .simulation-module-select-all,
        .simulation-compact-picker .simulation-module-option {
            min-height: 28px;
            padding: 0 9px;
            gap: 7px;
            border-radius: 999px;
            font-size: 12px;
            font-weight: 900;
            line-height: 1.12;
        }

        .simulation-compact-picker .simulation-module-select-all {
            margin-bottom: 4px;
            border: 1px solid var(--filter-pill-border, #c8d8ee);
            background: var(--filter-option-hover-bg, linear-gradient(180deg, #edf4ff 0%, #e1eeff 100%));
            color: var(--filter-pill-text, #24406e);
        }

        .simulation-compact-picker .simulation-module-option {
            background: var(--filter-option-bg, rgba(237, 244, 255, 0.72));
            color: var(--filter-pill-text, #24406e);
        }

        .simulation-compact-picker .simulation-module-option:hover {
            border-color: var(--filter-pill-border, #b9cff0);
            background: var(--filter-option-hover-bg, linear-gradient(180deg, #edf4ff 0%, #ddeafe 100%));
        }

        .simulation-compact-picker .simulation-module-option.is-selected {
            border-color: transparent;
            background: var(--filter-option-active-bg, linear-gradient(135deg, #3b82f6 0%, #2563eb 100%));
            color: var(--filter-option-active-text, #ffffff);
            box-shadow: 0 8px 16px var(--filter-pill-focus-ring, rgba(59, 130, 246, 0.18));
        }

        .simulation-compact-picker .simulation-module-option input[type="checkbox"],
        .simulation-compact-picker .simulation-module-select-all input[type="checkbox"] {
            width: 14px;
            height: 14px;
        }

        .simulation-compact-picker .simulation-module-btn-copy {
            gap: 1px !important;
        }

        .simulation-compact-picker .simulation-module-btn-label {
            font-size: 12px !important;
            font-weight: 900 !important;
            color: var(--filter-pill-text, #24406e) !important;
        }

        .simulation-compact-picker .simulation-module-btn-meta {
            font-size: 9px !important;
            color: #6a7c97 !important;
            font-weight: 800 !important;
        }

        #simulation-builder-panel .simulation-inline-controls-grid .simulation-field[class*="simulation-filter-theme-"] {
            --builder-filter-pill-bg: #ffffff !important;
            --builder-filter-border: #d5dee8 !important;
            --builder-filter-text: #334155 !important;
            --builder-filter-arrow: rgba(100, 116, 139, 0.82) !important;
            --builder-filter-focus: #cbd5e1 !important;
            --builder-filter-focus-ring: rgba(148, 163, 184, 0.12) !important;
            --builder-filter-panel-bg: #ffffff !important;
            --builder-filter-option-bg: #ffffff !important;
            --builder-filter-option-hover-bg: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%) !important;
            --builder-filter-option-active-bg: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%) !important;
            --builder-filter-shadow: rgba(148, 163, 184, 0.1) !important;
            --simulation-filter-accent: #334155 !important;
            --simulation-filter-btn-bg: #ffffff !important;
            --simulation-filter-panel-bg: #ffffff !important;
            --simulation-filter-option-bg: #ffffff !important;
            --simulation-filter-option-hover-bg: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%) !important;
            --simulation-filter-option-active-bg: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%) !important;
            --simulation-filter-border: #d5dee8 !important;
            --simulation-filter-shadow: rgba(148, 163, 184, 0.1) !important;
            --filter-pill-bg: #ffffff !important;
            --filter-pill-border: #d5dee8 !important;
            --filter-pill-text: #334155 !important;
            --filter-pill-arrow: rgba(100, 116, 139, 0.82) !important;
            --filter-pill-focus: #cbd5e1 !important;
            --filter-pill-focus-ring: rgba(148, 163, 184, 0.12) !important;
            --filter-panel-bg: #ffffff !important;
            --filter-panel-shadow: 0 12px 26px rgba(148, 163, 184, 0.1) !important;
            --filter-option-bg: #ffffff !important;
            --filter-option-hover-bg: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%) !important;
            --filter-option-active-bg: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%) !important;
            --filter-option-active-text: #0f172a !important;
        }

        #simulation-builder-panel .simulation-inline-controls-grid .simulation-field-select,
        #simulation-builder-panel .simulation-inline-controls-grid .simulation-field-input,
        #simulation-builder-panel .simulation-compact-picker .simulation-module-btn,
        #simulation-builder-panel .multi-select .ms-btn {
            border: 1px solid #d5dee8 !important;
            background: #ffffff !important;
            background-image: none !important;
            color: #334155 !important;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.98), 0 3px 8px rgba(148, 163, 184, 0.05) !important;
        }

        #simulation-builder-panel .simulation-inline-controls-grid .simulation-field-select,
        #simulation-builder-panel .simulation-inline-controls-grid .simulation-field.simulation-filter-theme-distribution .simulation-field-select,
        #simulation-builder-panel #dist-mode {
            border-color: #d5dee8 !important;
            background-image:
                linear-gradient(45deg, transparent 50%, rgba(100, 116, 139, 0.82) 50%),
                linear-gradient(135deg, rgba(100, 116, 139, 0.82) 50%, transparent 50%),
                linear-gradient(180deg, #ffffff 0%, #ffffff 100%) !important;
            background-position:
                calc(100% - 14px) calc(50% - 2px),
                calc(100% - 10px) calc(50% - 2px),
                0 0 !important;
            background-size: 6px 6px, 6px 6px, 100% 100% !important;
            background-repeat: no-repeat !important;
            color: #334155 !important;
        }

        #simulation-builder-panel .simulation-inline-controls-grid .simulation-field-select:focus,
        #simulation-builder-panel .simulation-inline-controls-grid .simulation-field-input:focus,
        #simulation-builder-panel .simulation-compact-picker .simulation-module-btn:focus,
        #simulation-builder-panel .multi-select .ms-btn:focus,
        #simulation-builder-panel .multi-select .ms-btn.active,
        #simulation-builder-panel .simulation-module-picker.is-open .simulation-module-btn {
            border-color: #cbd5e1 !important;
            box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12) !important;
        }

        #simulation-builder-panel .simulation-compact-picker .simulation-module-btn-label,
        #simulation-builder-panel .simulation-compact-picker .simulation-module-btn-meta,
        #simulation-builder-panel .multi-select .ms-btn .ms-btn-label,
        #simulation-builder-panel .multi-select .ms-btn i,
        #simulation-builder-panel .simulation-module-btn-icon {
            color: #334155 !important;
        }

        #simulation-builder-panel .simulation-compact-picker .simulation-module-panel,
        #simulation-builder-panel .multi-select .ms-panel {
            border: 1px solid #d5dee8 !important;
            background: #ffffff !important;
            box-shadow: 0 18px 34px rgba(148, 163, 184, 0.12) !important;
        }

        #simulation-builder-panel .simulation-compact-picker .simulation-module-select-all,
        #simulation-builder-panel .simulation-compact-picker .simulation-module-option,
        #simulation-builder-panel .multi-select .ms-item {
            border-color: #e2e8f0 !important;
            background: #ffffff !important;
            color: #334155 !important;
        }

        #simulation-builder-panel .simulation-compact-picker .simulation-module-select-all:hover,
        #simulation-builder-panel .simulation-compact-picker .simulation-module-option:hover,
        #simulation-builder-panel .multi-select .ms-item:hover {
            background: #f8fafc !important;
        }

        #simulation-builder-panel .simulation-compact-picker .simulation-module-option.is-selected,
        #simulation-builder-panel .multi-select .ms-item.selected {
            background: #f1f5f9 !important;
            color: #0f172a !important;
            box-shadow: none !important;
        }

        .simulation-title-count-field {
            max-width: 82px;
        }

        .simulation-table-filters {
            margin-bottom: 8px !important;
        }

        .todo-list-toolbar {
            padding: 7px 10px !important;
        }

        .todo-filter-select,
        #srs-block .srs-filter-select {
            padding-inline: 11px !important;
        }

        .todo-filter-select {
            min-width: 112px !important;
        }

        @media (max-width: 768px) {

            #srs-block .srs-filters-grid {
                grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
                gap: 4px !important;
            }

            #srs-block .srs-filter-select {
                height: 28px !important;
                padding: 0 7px !important;
                border-radius: 10px !important;
                font-size: 12px !important;
            }

            #srs-block #srs-filter-day {
                grid-column: 1 / -1;
            }
        }

        .search-input-container {
            position: relative;
        }

        .search-input {
            width: 100%;
            padding: 12px 15px 12px 45px;
            border: 2px solid #e2e8f0;
            border-radius: 12px;
            font-size: 14px;
            transition: all 0.3s;
        }

        .search-input:focus {
            border-color: #8b5cf6;
            outline: none;
            box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
        }

        .search-icon {
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            color: #94a3b8;
            font-size: 16px;
        }

        .clear-history-btn {
            background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
            color: white;
            border: none;
            padding: 6px 12px;
            border-radius: 8px;
            font-size: 11px;
            font-weight: bold;
            cursor: pointer;
            margin-top: 12px;
            width: 100%;
            transition: all 0.3s;
        }

        .clear-history-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 15px rgba(239, 68, 68, 0.3);
        }

        .delete-history-btn {
            position: absolute;
            top: 8px;
            right: 8px;
            background: none;
            border: none;
            color: #ef4444;
            cursor: pointer;
            font-size: 11px;
            opacity: 0;
            transition: opacity 0.3s;
        }

        .history-item:hover .delete-history-btn {
            opacity: 1;
        }

        .toggle-icon {
            transition: transform 0.3s;
        }

        .collapsed .toggle-icon {
            transform: rotate(-90deg);
        }

        .count-badge {
            font-size: 10px;
            padding: 2px 6px;
            border-radius: 6px;
            background: linear-gradient(135deg, rgba(79, 70, 229, 0.2) 0%, rgba(124, 58, 237, 0.2) 100%);
            margin-left: 6px;
            color: #4f46e5;
            font-weight: bold;
        }

        .toggle-content-btn {
            background: none;
            border: none;
            color: #4f46e5;
            cursor: pointer;
            font-size: 16px;
            margin-left: 12px;
            transition: all 0.3s;
        }

        .toggle-content-btn:hover {
            color: #7c3aed;
        }

        /* Sidebar Logo - Circular PNS logo only */
        .sidebar-logo {
            padding: 20px;
            border-bottom: 2px solid rgba(255, 255, 255, 0.1);
            text-align: center;
            background: rgba(0, 0, 0, 0.2);
        }

        .logo-circle {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            overflow: hidden;
            margin: 0 auto 15px;
            border: 3px solid rgba(255, 255, 255, 0.3);
            background: white;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 10px;
        }

        .logo-circle img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            border-radius: 50%;
        }

        .sidebar-logo .app-title {
            font-size: 18px;
            font-weight: bold;
            color: white;
        }

        .progress-bar {
            height: 5px;
            background: rgba(255, 255, 255, 0.2);
            border-radius: 2px;
            margin-top: 8px;
            overflow: hidden;
        }

        .progress-fill {
            height: 100%;
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            border-radius: 2px;
            transition: width 0.3s;
        }

        .module-header-right {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .text-context-menu.active {
            display: block;
        }

        .text-context-menu {
            position: fixed;
            display: none;
            width: 248px;
            max-width: calc(100vw - 20px);
            border-radius: 14px;
            border: 1px solid #dbe5ef;
            background: #ffffff;
            box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
            overflow: hidden;
            z-index: 6000;
        }

        .context-menu-header {
            padding: 8px 10px;
            background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
            border-bottom: 1px solid #dbe5ef;
            font-size: 11px;
            font-weight: 800;
            color: #475569;
            line-height: 1.4;
        }

        .context-menu-text-input {
            width: 100%;
            padding: 10px 12px;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            font-size: 13px;
            margin: 8px 16px;
            box-sizing: border-box;
            transition: all 0.3s;
        }

        .context-menu-text-input:focus {
            border-color: #4f46e5;
            outline: none;
        }

        .context-menu-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            width: 100%;
            min-height: 38px;
            padding: 8px 10px;
            border: none;
            background: white;
            color: #475569;
            font-size: 12px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s;
            text-align: left;
            border-bottom: 1px solid #f1f5f9;
            line-height: 1.25;
        }

        .context-menu-btn:last-child {
            border-bottom: none;
        }

        .context-menu-btn:hover {
            background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
            color: #4f46e5;
        }

        .context-menu-btn i {
            width: 14px;
            font-size: 13px;
            text-align: center;
        }

        .context-menu-ai-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 6px;
            padding: 8px 10px;
            border-bottom: 1px solid #f1f5f9;
            background: #f8fafc;
        }

        .context-menu-ai-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            min-height: 34px;
            padding: 0 8px;
            border-radius: 10px;
            border: 1px solid #dbe5ef;
            background: #ffffff;
            color: #334155;
            font-size: 11px;
            font-weight: 800;
            cursor: pointer;
            transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
        }

        .context-menu-ai-btn i {
            width: auto;
            font-size: 11px;
        }

        .context-menu-ai-btn:hover {
            transform: translateY(-1px);
        }

        .context-menu-ai-btn.is-chatgpt {
            background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 100%);
            border-color: #bbf7d0;
            color: #166534;
            box-shadow: 0 8px 16px rgba(22, 101, 52, 0.08);
        }

        .context-menu-ai-btn.is-claude {
            background: linear-gradient(180deg, #eff6ff 0%, #eef2ff 100%);
            border-color: #c7d2fe;
            color: #4338ca;
            box-shadow: 0 8px 16px rgba(67, 56, 202, 0.08);
        }

        body.dark-theme .text-context-menu {
            border-color: rgba(148, 163, 184, 0.22);
            background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
            box-shadow: 0 24px 44px rgba(2, 6, 23, 0.42);
        }

        body.dark-theme .context-menu-header {
            background: linear-gradient(180deg, #162033 0%, #111827 100%);
            border-bottom-color: rgba(148, 163, 184, 0.18);
            color: #dbeafe;
        }

        body.dark-theme .context-menu-btn {
            background: transparent;
            border-bottom-color: rgba(148, 163, 184, 0.12);
            color: #dbeafe;
        }

        body.dark-theme .context-menu-btn:hover {
            background: rgba(30, 41, 59, 0.9);
            color: #ffffff;
        }

        body.dark-theme .context-menu-ai-grid {
            background: rgba(15, 23, 42, 0.86);
            border-bottom-color: rgba(148, 163, 184, 0.12);
        }

        body.dark-theme .context-menu-ai-btn {
            border-color: rgba(148, 163, 184, 0.18);
            background: #111827;
            color: #e5eefc;
        }

        body.dark-theme .context-menu-ai-btn.is-chatgpt {
            background: rgba(20, 83, 45, 0.24);
            border-color: rgba(74, 222, 128, 0.24);
            color: #86efac;
            box-shadow: none;
        }

        body.dark-theme .context-menu-ai-btn.is-claude {
            background: rgba(49, 46, 129, 0.26);
            border-color: rgba(129, 140, 248, 0.24);
            color: #c7d2fe;
            box-shadow: none;
        }

        /* تعديل ارتفاع الهيدر العلوي */
        #quiz-header {
            height: 70px;
        }

        /* Styles for multiple correct answers */
        .multi-select-option {
            border-left: 4px solid #3b82f6;
        }

        .multi-selected {
            border-color: #3b82f6 !important;
            background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.1) 100%) !important;
        }

        .all-correct {
            border-color: #10b981 !important;
            background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%) !important;
        }

        .partially-correct {
            border-color: #f59e0b !important;
            background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.1) 100%) !important;
        }

        .multi-correct-answer {
            border-color: #10b981 !important;
            background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%) !important;
        }

        .multi-missed-answer {
            border-color: #f59e0b !important;
            background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.1) 100%) !important;
        }

        .correct-answer-badge {
            display: inline-block;
            padding: 2px 8px;
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            color: white;
            border-radius: 10px;
            font-size: 10px;
            font-weight: bold;
            margin-left: 8px;
        }

        .selected-answers-display {
            margin-top: 8px;
            padding: 0;
            background: transparent;
            border-radius: 0;
            border-left: none;
            font-size: 13px;
            display: none;
        }

        .selected-answers-display.show {
            display: block;
        }

        .answers-list {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 8px;
        }

        .answer-item {
            padding: 6px 12px;
            background: white;
            border-radius: 8px;
            border: 2px solid #e2e8f0;
            font-size: 12px;
            font-weight: bold;
        }

        .answer-item.correct {
            border-color: #15803d;
            background: linear-gradient(135deg, rgba(34, 197, 94, 0.12) 0%, rgba(22, 163, 74, 0.12) 100%);
            color: #166534;
        }

        .answer-item.selected {
            border-color: #3b82f6;
            background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.1) 100%);
        }

        .answer-item.wrong {
            border-color: #fca5a5;
            background: linear-gradient(135deg, rgba(254, 226, 226, 0.95) 0%, rgba(255, 241, 242, 0.95) 100%);
            color: #dc2626;
        }

        .answer-item.missed {
            border-color: #d97706;
            background: linear-gradient(135deg, rgba(254, 243, 199, 0.98) 0%, rgba(255, 251, 235, 0.98) 100%);
            color: #92400e;
        }

        .answer-item.neutral {
            border-style: dashed;
            border-color: #cbd5e1;
            background: #ffffff;
            color: #64748b;
        }

        .question-comment-card {
            margin-top: 12px;
            padding: 12px;
            border-radius: 18px;
            background:
                radial-gradient(circle at top left, rgba(191, 219, 254, 0.22), transparent 38%),
                linear-gradient(145deg, #fcfdff 0%, #f3f7ff 55%, #ffffff 100%);
            border: 1px solid rgba(191, 219, 254, 0.88);
            box-shadow: 0 14px 28px rgba(37, 99, 235, 0.08);
        }

        .question-comment-head {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 10px;
            margin-bottom: 8px;
        }

        .question-comment-title {
            font-size: 11px;
            font-weight: 900;
            color: #0f172a;
        }

        .question-comment-subtitle {
            margin-top: 2px;
            font-size: 9px;
            color: #64748b;
        }

        .question-comment-count {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 24px;
            padding: 0 9px;
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.88);
            border: 1px solid rgba(191, 219, 254, 0.96);
            color: #1d4ed8;
            font-size: 9px;
            font-weight: 900;
            white-space: nowrap;
        }

        .question-comment-count.is-limit {
            background: #fef3c7;
            border-color: #fcd34d;
            color: #b45309;
        }

        .question-comment-input {
            width: 100%;
            min-height: 86px;
            resize: vertical;
            border-radius: 14px;
            border: 1.5px solid #cbd5e1;
            background: rgba(255, 255, 255, 0.96);
            padding: 12px 13px;
            font-size: 12px;
            font-weight: 600;
            line-height: 1.5;
            color: #0f172a;
            box-shadow: inset 0 1px 2px rgba(148, 163, 184, 0.10);
        }

        .question-comment-input:focus {
            outline: none;
            border-color: #60a5fa;
            box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.15);
        }

        .question-comment-actions {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            flex-wrap: wrap;
            margin-top: 8px;
        }

        .question-comment-action-buttons {
            display: inline-flex;
            align-items: center;
            justify-content: flex-end;
            gap: 8px;
            flex-wrap: wrap;
            margin-left: auto;
        }

        .question-comment-action-hint {
            font-size: 9px;
            font-weight: 700;
            color: #64748b;
        }

        .question-comment-save-btn,
        .question-comment-audio-btn,
        .question-comment-voice-btn,
        .question-comment-cancel-btn,
        .question-comment-item-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            min-height: 30px;
            padding: 0 12px;
            border-radius: 999px;
            font-size: 10px;
            font-weight: 900;
            line-height: 1;
            transition: all 0.2s ease;
            cursor: pointer;
            border: 1px solid transparent;
        }

        .question-comment-save-btn {
            border-color: #bfdbfe;
            background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
            color: #ffffff;
            box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
        }

        .question-comment-voice-btn {
            border-color: #99f6e4;
            background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
            color: #0f766e;
            box-shadow: 0 10px 22px rgba(13, 148, 136, 0.14);
        }

        .question-comment-audio-btn {
            border-color: #fde68a;
            background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
            color: #a16207;
            box-shadow: 0 10px 22px rgba(217, 119, 6, 0.16);
        }

        .question-comment-audio-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 14px 26px rgba(217, 119, 6, 0.2);
        }

        .question-comment-audio-btn.is-recording {
            border-color: #fecaca;
            background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
            color: #be123c;
            box-shadow: 0 12px 24px rgba(225, 29, 72, 0.16);
        }

        .question-comment-audio-btn:disabled {
            opacity: 0.55;
            cursor: not-allowed;
            box-shadow: none;
            transform: none;
        }

        .question-comment-voice-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 14px 26px rgba(13, 148, 136, 0.18);
        }

        .question-comment-voice-btn.is-recording {
            border-color: #fecaca;
            background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
            color: #be123c;
            box-shadow: 0 12px 24px rgba(225, 29, 72, 0.16);
        }

        .question-comment-voice-btn:disabled {
            opacity: 0.55;
            cursor: not-allowed;
            box-shadow: none;
            transform: none;
        }

        .question-comment-save-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 14px 26px rgba(37, 99, 235, 0.22);
        }

        .question-comment-save-btn:disabled {
            opacity: 0.55;
            cursor: not-allowed;
            transform: none;
        }

        .question-comment-cancel-btn {
            border-color: #dbe4ec;
            background: #ffffff;
            color: #475569;
        }

        .question-comment-cancel-btn:hover {
            background: #f8fafc;
            border-color: #cbd5e1;
        }

        .question-comment-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
            margin-top: 10px;
        }

        .question-comment-item {
            padding: 10px 11px;
            border-radius: 14px;
            border: 1px solid #dbe7f3;
            background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
            box-shadow: 0 8px 20px rgba(148, 163, 184, 0.08);
        }

        .question-comment-item-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            margin-bottom: 6px;
        }

        .question-comment-item-badge {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            font-size: 9px;
            font-weight: 900;
            color: #1d4ed8;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .question-comment-item-date {
            font-size: 9px;
            font-weight: 700;
            color: #64748b;
            white-space: nowrap;
        }

        .question-comment-item-text {
            font-size: 11px;
            line-height: 1.5;
            color: #1e293b;
            white-space: pre-wrap;
            overflow-wrap: anywhere;
        }

        .question-comment-item-actions {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 6px;
            margin-top: 8px;
            flex-wrap: wrap;
        }

        .question-comment-item-audio {
            margin-top: 8px;
            display: grid;
            gap: 6px;
            padding: 8px;
            border-radius: 12px;
            border: 1px solid rgba(191, 219, 254, 0.92);
            background: linear-gradient(180deg, rgba(239, 246, 255, 0.9) 0%, rgba(243, 248, 255, 0.96) 100%);
        }

        .question-comment-audio-player {
            width: 100%;
            height: 30px;
        }

        .question-comment-item-audio-actions {
            display: flex;
            justify-content: flex-end;
            gap: 6px;
            flex-wrap: wrap;
        }

        .question-comment-item-btn {
            min-height: 26px;
            padding: 0 10px;
            font-size: 9px;
            box-shadow: none;
        }

        .question-comment-item-btn.edit {
            border-color: #bfdbfe;
            background: #eff6ff;
            color: #1d4ed8;
        }

        .question-comment-item-btn.delete {
            border-color: #fecaca;
            background: #fff5f5;
            color: #dc2626;
        }

        .question-comment-item-btn.audio-download {
            border-color: #bfdbfe;
            background: #eff6ff;
            color: #1d4ed8;
        }

        .question-comment-item-btn.audio-delete {
            border-color: #fecaca;
            background: #fff5f5;
            color: #dc2626;
        }

        .question-comment-empty {
            margin-top: 10px;
            padding: 12px;
            border-radius: 14px;
            border: 1px dashed #cbd5e1;
            background: rgba(255, 255, 255, 0.82);
            color: #64748b;
            font-size: 10px;
            font-weight: 700;
            text-align: center;
        }

        .question-comment-footer-spacer {
            height: 24px;
        }

        /* Fix for filter selection panels */
        .filter-selection-panel {
            z-index: 4300;
        }

        .filter-badge {
            position: relative;
        }

        .filter-badge.filter-badge-open {
            z-index: 4600 !important;
        }

        /* Search box */
        .search-box {
            flex: 1;
        }

        .search-box input {
            width: 100%;
            padding: 10px 15px;
            border: 2px solid #e2e8f0;
            border-radius: 10px;
            font-size: 14px;
        }

        .search-box input:focus {
            border-color: #4f46e5;
            outline: none;
        }

        /* Question count input */
        .q-count-input {
            width: 50px;
            padding: 2px 6px;
            border: 1px solid #cbd5e1;
            border-radius: 8px;
            font-size: 10px;
            text-align: center;
            margin-left: 6px;
        }

        /* Explication générale button */
        .explication-btn {
            background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
            color: white;
            padding: 10px 20px;
            border-radius: 10px;
            font-size: 14px;
            font-weight: bold;
            border: none;
            cursor: pointer;
        }

        /* Mobile fixes */
        .mobile-scroll-fix {
            overflow-y: auto;
            max-height: 100vh;
            height: 100%;
            padding-bottom: 0 !important;
        }

        /* Selection highlight */
        ::selection {
            background: rgba(79, 70, 229, 0.2);
        }

        .qcm-inline-highlight {
            display: inline;
            background: rgba(250, 204, 21, 0.46);
            color: inherit;
            border-radius: 0.28em;
            padding: 0 0.08em;
            box-decoration-break: clone;
            -webkit-box-decoration-break: clone;
        }

        .qcm-inline-underline {
            display: inline;
            text-decoration-line: underline;
            text-decoration-thickness: 2px;
            text-underline-offset: 0.16em;
            text-decoration-color: #2563eb;
            color: inherit;
            border-radius: 0.16em;
            padding: 0 0.04em;
            box-decoration-break: clone;
            -webkit-box-decoration-break: clone;
        }

        .opt-btn,
        .opt-btn .opt-text,
        .opt-btn .opt-id {
            user-select: text;
            -webkit-user-select: text;
        }

        /* Additional options styling */
        .total-qcm-input-group {
            margin-bottom: 20px;
        }

        .total-qcm-input-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: bold;
            color: #475569;
        }

        .total-qcm-input {
            width: 100px;
            padding: 8px 12px;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            font-size: 14px;
            text-align: center;
        }

        .qcm-available {
            margin-top: 5px;
            font-size: 12px;
            color: #64748b;
        }

        .error-message {
            color: #ef4444;
            font-size: 12px;
            margin-top: 5px;
            display: none;
        }

        .question-duplicate-count {
            font-size: 11px;
            color: #64748b;
            font-style: italic;
            margin-top: 5px;
            display: inline-block;
            background: #f1f5f9;
            padding: 2px 8px;
            border-radius: 10px;
        }

        /* Hide sidebar when filtering */
        .filtering-active #sidebar-nav {
            display: none !important;
        }

        /* Question duplicate info */
        .question-duplicate-info {
            font-size: 11px;
            color: #64748b;
            margin-top: 5px;
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .show-duplicates-checkbox {
            margin-right: 5px;
        }

        /* Timer position */
        .question-timers-container {
            margin: 15px 0;
        }

        /* Search bar after vérifier réponse */
        .search-bar-after-verify {
            margin-top: 20px;
            padding: 15px;
            background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
            border-radius: 12px;
            border: 2px solid #e2e8f0;
        }

        /* History sidebar */
        .history-sidebar {
            position: fixed;
            top: var(--app-top-safe-offset, 0px);
            right: 0;
            width: 300px;
            height: calc(100vh - var(--app-top-safe-offset, 0px));
            height: calc(100dvh - var(--app-top-safe-offset, 0px));
            background: white;
            z-index: 1000;
            box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
            transform: translateX(100%);
            transition: transform 0.3s ease;
            display: flex;
            flex-direction: column;
        }

        .history-sidebar.active {
            transform: translateX(0);
        }

        .history-sidebar-header {
            padding: 20px;
            background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
            color: white;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .history-sidebar-content {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
        }

        /* History panel - Full screen */
        #history-panel {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: white;
            z-index: 10001;
            display: none;
            flex-direction: column;
            overflow: hidden;
        }

        #history-panel.active {
            display: flex;
        }

        .history-panel-header {
            padding: 20px 30px;
            background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
            color: white;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }

        .history-panel-content {
            flex: 1;
            overflow-y: auto;
            padding: 30px;
        }

        .history-panel-filters {
            padding: 20px 30px;
            background: #f8fafc;
            border-bottom: 2px solid #e2e8f0;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
        }

        .history-panel-close-btn {
            background: rgba(255, 255, 255, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.3);
            color: white;
            padding: 8px 15px;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s;
        }

        .history-panel-close-btn:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        /* Close button for sidebars */
        .close-sidebar-btn {
            background: none;
            border: none;
            color: white;
            font-size: 20px;
            cursor: pointer;
            padding: 5px;
        }

        /* Duplicate counters */
        .duplicate-counter {
            font-size: 10px;
            background: #f1f5f9;
            color: #64748b;
            padding: 2px 6px;
            border-radius: 10px;
            margin-left: 5px;
        }

        .question-duplicate-counter {
            background: #dbeafe;
            color: #1d4ed8;
        }

        .instruction-duplicate-counter {
            background: #dcfce7;
            color: #166534;
        }

        .option-duplicate-counter {
            background: #fef3c7;
            color: #92400e;
        }

        /* Question buttons row */
        .question-buttons-row {
            display: flex;
            gap: 10px;
            margin-top: 20px;
            justify-content: center;
        }

        .question-btn {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 12px 15px;
            border-radius: 12px;
            border: none;
            color: white;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s;
            min-width: 80px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        }

        .question-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
        }

        .question-btn i {
            font-size: 18px;
            margin-bottom: 5px;
        }

        .question-btn span {
            font-size: 11px;
        }

        .btn-prev {
            background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
        }

        .btn-next {
            background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        }

        .btn-verify {
            background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
        }

        .btn-explain {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        }

        /* Left sidebar scroll */
        #left-sidebar nav {
            overflow-y: auto;
            height: calc(100vh - 200px);
        }

        /* Main action buttons bar */
        .main-action-buttons {
            display: flex;
            gap: 10px;
            margin: 20px 0;
            justify-content: center;
            flex-wrap: wrap;
        }

        .main-action-btn {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px 20px;
            border-radius: 12px;
            border: none;
            color: white;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s;
            min-width: 180px;
            justify-content: center;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        }

        .main-action-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
        }

        .study-main-actions {
            display: flex !important;
            flex-wrap: nowrap !important;
            gap: 6px !important;
            margin: 12px 0 !important;
            overflow-x: auto;
            padding-bottom: 2px;
        }

        .study-main-action-btn {
            min-width: 0 !important;
            flex: 1 1 0 !important;
            padding: 7px 8px !important;
            border-radius: 9px !important;
            gap: 5px !important;
            font-size: 11px !important;
            white-space: nowrap;
        }

        .study-main-action-btn i {
            font-size: 10px;
        }

        .btn-verify-main {
            background: #ffffff;
            color: #16a34a;
            border: 1.5px solid #86efac;
            box-shadow: 0 4px 10px rgba(22, 163, 74, 0.12);
        }

        .btn-prev-main {
            background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
        }

        .btn-next-main {
            background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        }

        .btn-explain-main {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        }

        .btn-terminate-main {
            background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
        }

        /* ترجمة الاقتراحات - تحتها مباشرة */
        .translation-option {
            margin-left: 40px;
            margin-top: 5px;
            padding: 5px 10px;
            background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
            border-radius: 8px;
            font-size: 11px;
            color: #475569;
            border-left: 3px solid #3b82f6;
            display: none;
        }

        .translation-option.show {
            display: block;
        }

        /* تصنيف النجوم للسؤال */
        .question-rating-stars {
            display: flex;
            gap: 5px;
            margin-top: 10px;
            justify-content: center;
        }

        .rating-star {
            font-size: 20px;
            color: #cbd5e1;
            cursor: pointer;
            transition: color 0.3s;
        }

        .rating-star.active {
            color: #fbbf24;
        }

        .rating-star:hover,
        .rating-star:hover~.rating-star {
            color: #fbbf24;
        }

        /* Modal للتعليمات والصور */
        .word-info-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            z-index: 9999;
            justify-content: center;
            align-items: center;
        }

        .word-info-modal.active {
            display: flex;
        }

        .word-info-content {
            background: white;
            border-radius: 15px;
            width: 90%;
            max-width: 600px;
            max-height: 80vh;
            overflow-y: auto;
            padding: 20px;
            position: relative;
        }

        .word-info-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
            padding-bottom: 10px;
            border-bottom: 2px solid #e2e8f0;
        }

        .word-info-title {
            font-size: 18px;
            font-weight: bold;
            color: #4f46e5;
        }

        .word-info-body {
            display: flex;
            flex-direction: column;
            gap: 15px;
        }

        .word-info-image {
            max-width: 100%;
            max-height: 300px;
            border-radius: 10px;
            margin: 0 auto;
            display: block;
        }

        .word-info-explanation {
            font-size: 14px;
            line-height: 1.6;
            color: #475569;
        }

        /* Exam mode icon - تم حذفه */

        /* زر الترجمة تحت الاقتراحات */
        .translate-btn-container {
            display: flex;
            justify-content: flex-end;
            margin-top: 10px;
            margin-bottom: 15px;
        }

        .translate-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 15px;
            background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
            color: white;
            border: none;
            border-radius: 10px;
            font-size: 12px;
            font-weight: bold;
            cursor: pointer;
        }

        .translate-dropdown {
            position: relative;
            z-index: 4200;
        }

        .translate-dropdown.dropdown-open {
            z-index: 25000 !important;
        }

        .translate-options {
            position: absolute;
            top: calc(100% + 6px);
            bottom: auto;
            right: 0;
            background: white;
            border-radius: 10px;
            border: 1px solid #dbeafe;
            box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
            width: 132px;
            min-width: 132px;
            z-index: 26000;
            display: none;
            padding: 4px 0;
            overflow: hidden;
        }

        .translate-options.active {
            display: block;
        }

        .translate-option {
            padding: 6px 9px;
            cursor: pointer;
            transition: background 0.3s;
            font-size: 8px;
            font-weight: 800;
            line-height: 1.1;
            white-space: nowrap;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .translate-option i {
            font-size: 8px;
            width: 10px;
            text-align: center;
        }

        .translate-option:hover {
            background: #f1f5f9;
        }

        /* فلترة الكليات */
        .faculty-filter {
            margin-top: 0;
        }

        /* سطر واحد للكرونومتر والترجمة والتقييم */
        .top-controls-row {
            display: flex;
            align-items: center;
            gap: 15px;
            margin: 15px 0;
            justify-content: center;
            flex-wrap: wrap;
        }

        /* زر ترجمة كبير */
        .large-translate-btn {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px 20px;
            background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
            color: white;
            border: none;
            border-radius: 12px;
            font-size: 14px;
            font-weight: bold;
            cursor: pointer;
            min-height: 50px;
            box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
            transition: all 0.3s;
        }

        .large-translate-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 15px rgba(59, 130, 246, 0.4);
        }

        /* تصنيف النجوم كبير */
        .large-rating-stars {
            display: flex;
            gap: 5px;
            align-items: center;
            min-height: 50px;
            padding: 0 10px;
        }

        .large-star {
            font-size: 24px;
            color: #cbd5e1;
            cursor: pointer;
            transition: color 0.3s;
        }

        .large-star.active {
            color: #fbbf24;
        }

        .large-star:hover,
        .large-star:hover~.large-star {
            color: #fbbf24;
        }

        /* كرونومتر كبير */
        .large-timer-box {
            background: white;
            border-radius: 12px;
            padding: 12px 20px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            min-width: 120px;
            border-left: 4px solid #3b82f6;
            min-height: 50px;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

        .large-timer-label {
            font-size: 11px;
            font-weight: bold;
            color: #64748b;
            text-transform: uppercase;
            margin-bottom: 4px;
        }

        .large-timer-value {
            font-size: 20px;
            font-weight: 900;
            color: #1e293b;
        }

        /* Responsive for mobile */
        @media (max-width: 768px) {
            .top-controls-row {
                flex-direction: column;
                gap: 10px;
            }

            .large-translate-btn,
            .large-timer-box,
            .large-rating-stars {
                width: 100%;
                justify-content: center;
            }

            .large-rating-stars {
                padding: 10px;
            }
        }

        /* تصغير حجم الأسطر في القائمة الجانبية للتعليمات */
        #nav-items-container button,
        #workspace-nav-items-container button {
            padding: 8px 12px !important;
            margin-bottom: 4px !important;
            font-size: 12px !important;
            min-height: 40px !important;
            min-width: 0;
            overflow: hidden;
            box-sizing: border-box;
        }

        #sidebar-nav {
            border-bottom: none !important;
        }

        #sidebar-nav.hidden {
            display: none !important;
            width: 0 !important;
            min-width: 0 !important;
        }

        #nav-items-container {
            padding-bottom: 14px !important;
            margin-bottom: 0 !important;
        }

        #nav-items-container button span,
        #workspace-nav-items-container button span {
            font-size: 11px !important;
            line-height: 1.3 !important;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            display: block;
        }

        #nav-items-container button span:first-child,
        #workspace-nav-items-container button span:first-child {
            flex: 1 1 auto;
        }

        #nav-items-container button span:last-child,
        #workspace-nav-items-container button span:last-child {
            flex: 0 0 auto;
            overflow: visible;
            text-overflow: clip;
            white-space: nowrap;
        }

        /* تصحيح مشكلة ظهور الحرف t مع العداد المكرر */
        .opt-text .duplicate-counter {
            display: inline-block;
        }

        /* إخفاء الحرف t الذي يظهر قبل العداد */
        /* Utilisation d'une méthode différente pour résoudre le problème */

        /* حل بديل: تغيير طريقة عرض العداد المكرر */
        .opt-text .option-duplicate-counter {
            display: inline-block;
            margin-left: 5px;
        }

        /* منع ظهور الحرف t */
        .opt-text br {
            display: none;
        }

        /* الإحصائيات تحت الكويزمات */
        .stats-section {
            margin-top: 30px;
            padding: 20px;
            background: white;
            border-radius: 15px;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
        }

        .stats-title {
            font-size: 16px;
            font-weight: bold;
            color: #4f46e5;
            margin-bottom: 15px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 15px;
        }

        .stat-item {
            background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
            padding: 15px;
            border-radius: 12px;
            border-left: 4px solid #3b82f6;
        }

        .stat-label {
            font-size: 12px;
            color: #64748b;
            margin-bottom: 5px;
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 14px;
        }

        .stat-label i {
            font-size: 12px;
            color: #64748b;
        }

        .stat-value {
            font-size: 20px;
            font-weight: bold;
            color: #1e293b;
        }

        /* أنماط شريط البحث */
        .search-container {
            margin-bottom: 20px;
            transition: all 0.3s ease;
        }

        .search-wrapper {
            position: relative;
            display: flex;
            align-items: center;
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 2px solid rgba(255, 255, 255, 0.5);
            border-radius: 20px;
            box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
            padding: 0;
            overflow: hidden;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .search-wrapper::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
            opacity: 0;
            transition: opacity 0.3s ease;
            z-index: -1;
        }

        .search-wrapper:focus-within::before {
            opacity: 1;
        }

        .search-wrapper:focus-within {
            transform: translateY(-2px);
            box-shadow: 0 12px 40px rgba(31, 38, 135, 0.2);
            border-color: rgba(59, 130, 246, 0.3);
        }

        .search-wrapper:focus-within {
            border-color: rgba(139, 92, 246, 0.3);
            box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1), 0 4px 20px rgba(31, 38, 135, 0.15);
            background: rgba(255, 255, 255, 0.95);
        }

        .search-icon {
            color: #9ca3af;
            padding: 0 16px;
            font-size: 18px;
            position: absolute;
            left: 16px;
            top: 50%;
            transform: translateY(-50%);
            z-index: 2;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .search-wrapper:focus-within .search-icon {
            color: #3b82f6;
            transform: translateY(-50%) scale(1.1);
        }

        .search-input {
            flex: 1;
            border: none;
            background: transparent;
            padding: 16px 16px 16px 48px;
            font-size: 16px;
            font-weight: 500;
            color: #1f2937;
            outline: none;
            width: 100%;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .search-input::placeholder {
            color: #9ca3af;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            font-weight: 400;
        }

        .search-input:focus::placeholder {
            opacity: 0.7;
            transform: translateX(2px);
        }

        /* إضافة تأثيرات للكتابة */
        .search-input {
            position: relative;
        }

        .search-input::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            width: 0;
            height: 2px;
            background: linear-gradient(90deg, #3b82f6, #8b5cf6);
            transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            transform: translateX(-50%);
        }

        .search-input:focus::after {
            width: 80%;
        }

        .search-input::placeholder {
            color: #a0aec0;
        }

        .clear-search-btn {
            position: absolute;
            right: 16px;
            top: 50%;
            transform: translateY(-50%);
            background: #f3f4f6;
            border: none;
            color: #6b7280;
            cursor: pointer;
            padding: 8px;
            border-radius: 10px;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            opacity: 0;
            visibility: hidden;
            transform: translateY(-50%) scale(0.8);
        }

        .clear-search-btn:hover {
            background: #e5e7eb;
            color: #374151;
            transform: translateY(-50%) scale(1.1);
        }

        .clear-search-btn[style*="block"] {
            opacity: 1;
            visibility: visible;
            transform: translateY(-50%) scale(1);
        }

        /* إخفاء الفلاتر عند البحث */
        .search-active .filters-container {
            opacity: 0.3;
            pointer-events: none;
        }

        .search-active .modules-container,
        .search-active .lessons-grid {
            display: none;
        }

        .search-results {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: white;
            border-radius: 16px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
            margin-top: 8px;
            max-height: 400px;
            overflow-y: auto;
            opacity: 0;
            transform: translateY(-10px);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            visibility: hidden;
            z-index: 1000;
            padding: 8px;
        }

        .search-results.active {
            opacity: 1;
            transform: translateY(0);
            visibility: visible;
        }

        .search-result-item {
            padding: 12px 16px;
            border-radius: 10px;
            margin-bottom: 8px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .search-result-item:hover {
            background: rgba(139, 92, 246, 0.08);
            transform: translateX(4px);
        }

        .search-result-title {
            font-weight: 600;
            color: #2d3748;
            margin-bottom: 4px;
        }

        .search-result-path {
            font-size: 12px;
            color: #718096;
        }

        .search-result-type {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 20px;
            font-size: 10px;
            font-weight: 600;
            margin-left: 8px;
            text-transform: uppercase;
        }

        .search-result-type.year {
            background: rgba(59, 130, 246, 0.1);
            color: #2563eb;
        }

        .search-result-type.module {
            background: rgba(16, 185, 129, 0.1);
            color: #047857;
        }

        .search-result-type.lesson {
            background: rgba(245, 158, 11, 0.1);
            color: #d97706;
        }

        .search-result-group {
            margin-bottom: 16px;
            border-radius: 12px;
            overflow: hidden;
            background: white;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        .search-result-group-title {
            padding: 12px 16px;
            background: #f9fafb;
            font-weight: 600;
            color: #4b5563;
            border-bottom: 1px solid #e5e7eb;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .search-result-group-title::before {
            content: '';
            width: 4px;
            height: 4px;
            background: #3b82f6;
            border-radius: 50%;
        }

        .search-result-group .search-result-item {
            border-bottom: none;
            margin: 0;
            padding: 12px 16px;
            transition: all 0.2s ease;
        }

        .search-result-group .search-result-item:hover {
            background: #f3f4f6;
            transform: translateX(8px);
        }

        .search-result-group .search-result-item label {
            width: 100%;
            padding: 4px 0;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .search-result-group .search-result-item input[type="checkbox"] {
            width: 18px;
            height: 18px;
            cursor: pointer;
            accent-color: #3b82f6;
        }

        .search-result-group .search-result-item span {
            font-size: 15px;
            color: #1f2937;
            font-weight: 500;
        }

